All you need to do to configure dhtmlxGrid on the server side is to:
var config = new dhtmlxGridConfiguration();
config.SetHeader("Item,#cspan");
config.AttachHeader("Sales,Title");
config.SetColIds("col1,col2");
config.SetInitWidths("120,*");
config.SetColSorting("connector,connector");
config.SetColColor(",#d5f1ff");
config.SetColHidden("false,false");
config.SetColTypes("ro,ed");
config.SetColAlign("center,center");
config.SetColVAlign("bottom,middle");
connector.SetConfig(config);
return connector;
dhtmlxConfiguration has the following methods:
public string HeaderDelimiter // gets or sets header delimiter
public void SetHeader(string names)//headers names separated by delimiter(','by default)
public void SetInitWidths(string wp) // sets dhtmlxGrid columns widths in pixels
public void SetInitWidthsP(string wp) // sets dhtmlxGrid columns widths in percents
public void SetColAlign(string str) //sets dhtmlxGrid columns horizontal align
public void SetColVAlign(string str) // sets dhtmlxGrid columns vertical align
public void SetColTypes(string str) // sets dhtmlxGrid columns types
public void SetColSorting(string str) // sets dhtmlxGrid columns sorting types
public void SetColColor(string str) // sets dhtmlxGrid columns colors
public void SetColHidden(string str) // sets dhtmlxGrid hidden columns
public void SetColIds(string str) // sets dhtmlxGrid columns ids
//attaches dhtmlxGrid header
//"values" - header titles separated by delimiter
//"styles" - header styles separated by delimiter
//"footer" if true attaches footer
public void AttachHeader(string values, string styles = null, boolean footer false)
//attaches dhtmlxGrid Footer
//"values" - footer titles separated by delimiter
//"styles" - footer styles separated by delimiter
public void AttachFooter(string values, string styles = null) {
AttachHeader(values, styles, true);
}
Back to top