Monday, August 31, 2015

The Page_Load event is going to fire even on a callback in the DevExpress paradigm.

That kinda makes my head want to explode, but it is what it is. The page will not postback, and yet the Page_Load event will rerun. If you are using the Page_Load event to set up controls which then affect an ASPxGridView and you want to set up the controls in the Page_Load event but not reset the controls on every callback, pehaps you should call a callback on the ASPxGridView itself and not a callback on a ASPxCallbackPanel wrapping everything.

a ASPxComboBox in DevExpress is their DropDownList

<dx:ASPxComboBox ID="WhichEnvironment" ClientInstanceName="WhichEnvironment"
      runat="server" ToolTip="View Roles">
   <Items>
      <dx:ListEditItem Text="Quality Assurance" Value="3"></dx:ListEditItem>
      <dx:ListEditItem Text="Production" Value="1" Selected="True"></dx:ListEditItem>
   </Items>
   <ClientSideEvents SelectedIndexChanged="function(s, e) {
         ReportGrid.PerformCallback();
      }" />
</dx:ASPxComboBox>

Subversion conflicts (a better way?)

The formal way to deal with this is to use TortoiseMerge. Selects blobs of red where conflicts exist and right-click to pick options such as "Use this text block" or "Use text block from 'mine' before 'theirs'" and when all of the red is cleaned up click "Save" at the upper left and then say OK to "Mark as resolved" to finish up. Every line in every swath of red needs to be accounted for, even empty spaces, so you will want to drag a selection over the whole of red area before dealing with it.

the Settings inside a DevExpress ASPxGridView

This tag may have a multitude of concerns jammed into it or may just be left out. ShowGroupPanel is going to allow you to group by any row the way one groups by a row here while ShowFilterBar allows users to build their own filters.

<Settings HorizontalScrollBarMode="Visible" ShowFilterRow="True"
      ShowFilterRowMenu="True" ShowFooter="True" ShowGroupPanel="True"
      ShowFilterBar="Visible" />

Friday, August 28, 2015

add a horizontal scroll bar to a DevExpress ASPxGridView with many columns and thus much horizontal real estate

<dx:ASPxGridView ID="MyGrid" runat="server" Width="1057">
   <Settings HorizontalScrollBarMode="Visible" ShowFilterRow="True"
         ShowFilterRowMenu="True" />

 
 

Addendum 9/22/2015: This is also legit:

<Settings VerticalScrollBarMode="Visible" VerticalScrollableHeight="400" />

Don't store the last four digits of a credit card number as an int.

What if there is a leading zero? Or two? You'll have to do wacky stuff to compensate, right? This data point should be a nchar(4) at MSSQL and a string at C#. (This touches on the difference between nchar, char, varchar, and nvarchar. The items with the leading n can store Unicode characters (and thus they take up much more memory) while the others cannot. The items with var in the name are of variable length can be up to their specified length in length and can also be less while the nchar and char settings are going to use storage space for all x of their slots even if you use less than x.)

set the AutoPostBack setting to true at a asp:DropDownList to reload the Page_Load event in web forms

...whenever the dropdownlist is changed.