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,
I would like to add checkbox to rows in a table which has the main data.
previously, the code in InitializeRow event can function well.
Private Sub WebGrid1_InitializeRow(ByVal sender As Object, ByVal e As ISNet.WebUI.WebGrid.RowEventArgs) Handles WebGrid1.InitializeRow
If (e.Row.Cells.GetNamedItem("a_bid").Value = e.Row.Cells.GetNamedItem("bid").Value) Then
e.Row.Cells.GetNamedItem("Tick").Text = "<INPUT type='checkbox' Id='" & e.Row.Cells.GetNamedItem("bid").Value & "' name='" & e.Row.Cells.GetNamedItem("bid").Value & "' onclick=ChkClick('" & e.Row.Cells.GetNamedItem("bid").Value & "') >"
End If End Sub
but after i upgraded to webgrid 7, the code doesn't function well.
The checkbox column will show
<INPUT type='checkbox' Id='1234' name='1234' onclick=ChkClick('1234') >
instead of working like previously which shows checkbox in specified rows.
Do you have any ideas on the cause to the failure of the output?
Waiting for your kind reply.
Thank you.
xin8
In We Grid 7, you will need to set the WebGrid column ColumnType to custom in order to render HTML code. Here is the snippet for the Tick column:
<ISWebGrid:WebGridColumn Name="Tick" ColumnType="Custom" Caption=" " Width="30px"></ISWebGrid:WebGridColumn>
thank you very much Glenn!
i added your code in client side. It didn't work.
But then i do it in server side. It is a success!
Here's the snippet to share:
Private Sub WebGrid1_PrepareDataBinding(ByVal sender As Object, ByVal e As ISNet.WebUI.WebGrid.DataSourceEventArgs) Handles WebGrid1.PrepareDataBinding If Page.IsPostBack = False Then WebGrid1.RetrieveStructure() End If With WebGrid1.RootTable.Columns .GetNamedItem("Tick").Width = Unit.Pixel("30") .GetNamedItem("Tick").ColumnType = ISNet.WebUI.WebGrid.ColumnType.Custom End With End Sub
Thank you again.
Regards
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