iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
Hi
After clicking on Refresh button Checkbox is no longer in the middle!
Regards
Michael
Please try to set the checkbox horizontal align in InitializeRow server side event. Below is the snippet code to set the horizontal align of specific column.
e.Row.Cells.GetNamedItem("[ColumnName]").Style.HorizontalAlign = ISNet.WebUI.HorizontalAlign.Center;
I have checked that this event is invoked when user click the refresh button. So after clicking refresh button on WebGrid, the horizontal align of the checkbox column should be persisted.
Hope this helps.
Hi Michael,
How do you set cellstyle align center in checkbox column? Do you set it programmatically? if yes, in which event do you set it?
Hello,
It should be working. Please see my attached sample.In WebGridColumn level, i set CellStyle property>>HorizontalAlign=Center. When refresh, the alignment still there. Please let me know whether it works on you or not.
Regards,Handy
I set cellstyle programmatically in PrepareDataBinding Event.
I suspect the column losts HorizontalAlign because it is coded in Page.IsPostBack .
protected void grd_PrepareDataBinding(object sender, DataSourceEventArgs e) { if (!Page.IsPostBack) { WebGridColumn eID = grd.RootTable.Columns[0]; eID.Caption = "ID"; eID.Width = Unit.Pixel(250); eID.EditType = EditType.NoEdit; eID.Visible = QS.Roles.isQSAdmin; eID.IsAutoIncrement = true; WebGridColumn eName = grd.RootTable.Columns[1]; eName.Caption = "Bezeichnung"; eName.Width = Unit.Pixel(500); WebGridColumn eHide = grd.RootTable.Columns[2]; eHide.Caption = "Ausblenden"; eHide.Width = Unit.Pixel(80); eHide.CellStyle.HorizontalAlign = ISNet.WebUI.HorizontalAlign.Center; eHide.ColumnType = ColumnType.CheckBox; eHide.EditType = EditType.Checkbox; WebGridColumn eManuallyErrorDependencies = grd.RootTable.Columns[3]; eManuallyErrorDependencies.Caption = "MED"; eManuallyErrorDependencies.Width = Unit.Pixel(50); eManuallyErrorDependencies.EditType = EditType.NoEdit; eManuallyErrorDependencies.DefaultValue = "0"; eManuallyErrorDependencies.Visible = QS.Roles.isQSAdmin; WebGridColumn eDependencies = new WebGridColumn("Dependencies", "Ref"); eDependencies.ColumnType = ColumnType.Text; eDependencies.EditType = EditType.NoEdit; eDependencies.Width = Unit.Pixel(30); eDependencies.NewRowEditType = NewRowEditType.NoEdit; eDependencies.CellStyle.HorizontalAlign = ISNet.WebUI.HorizontalAlign.Center; eDependencies.CellStyle.VerticalAlign = ISNet.WebUI.VerticalAlign.Middle; grd.RootTable.Columns.Insert(0, eDependencies); } }
So I have change Code to this:
protected void grd_PrepareDataBinding(object sender, DataSourceEventArgs e) { if (!Page.IsPostBack) { grd.ClearCachedDataSource(); grd.RetrieveHierarchicalStructure(); lblTitle.Text = "Fehlerliste"; imgTitle.ImageUrl = "~/Image/Icon/24/document_error.png"; WebGridColumn eRef = new WebGridColumn("Dependencies", "Ref"); grd.RootTable.Columns.Insert(0, eRef); } WebGridColumn eDependencies = grd.RootTable.Columns[0]; eDependencies.ColumnType = ColumnType.Text; eDependencies.EditType = EditType.NoEdit; eDependencies.Width = Unit.Pixel(30); eDependencies.NewRowEditType = NewRowEditType.NoEdit; eDependencies.CellStyle.HorizontalAlign = ISNet.WebUI.HorizontalAlign.Center; eDependencies.CellStyle.VerticalAlign = ISNet.WebUI.VerticalAlign.Middle; WebGridColumn eID = grd.RootTable.Columns[1]; eID.Caption = "ID"; eID.Width = Unit.Pixel(250); eID.EditType = EditType.NoEdit; eID.Visible = QS.Roles.isQSAdmin; eID.IsAutoIncrement = true; WebGridColumn eName = grd.RootTable.Columns[2]; eName.Caption = "Bezeichnung"; eName.Width = Unit.Pixel(500); WebGridColumn eHide = grd.RootTable.Columns[3]; eHide.Caption = "Ausblenden"; eHide.Width = Unit.Pixel(80); eHide.CellStyle.HorizontalAlign = ISNet.WebUI.HorizontalAlign.Center; eHide.ColumnType = ColumnType.CheckBox; eHide.EditType = EditType.Checkbox; WebGridColumn eManuallyErrorDependencies = grd.RootTable.Columns[4]; eManuallyErrorDependencies.Caption = "MED"; eManuallyErrorDependencies.Width = Unit.Pixel(50); eManuallyErrorDependencies.EditType = EditType.NoEdit; eManuallyErrorDependencies.DefaultValue = "0"; eManuallyErrorDependencies.Visible = QS.Roles.isQSAdmin; }
Now Columnwith (Columnheader and Column) are not match. Please see attached file.
How can I do this?
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname