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
Which server side event on the webgrid do I used to control visibility of an image button. Also can you direct me to documention that describes each server side event on the webgrid?
Thanks
Greg
Which server side event on the webgrid do I used to control visibility of an image button...
Thank you for your recent inquiry about how to control visibility of ButtonImage ColumnType of WebGrid.
Due to popular demand, WebGrid now includes a new ButtonImage column type for handy button display with image. Although developers can use Template column type to specify any kind of contents such as <asp:Image>, it doesn't take advantage of WebGrid's postback mechanism and developers have to handle the events manually, which is time consuming.
The following screenshot shows a WebGrid using ButtonImage column type in the first column.
The sample ButtonImage definition in WebGridColumn is as following:
<ISWebGrid:WebGridColumn Name="btnInfo" ColumnType="ButtonImage" Width="30px" ButtonImage="images/info.gif" ButtonAutoPostback="true"> </ISWebGrid:WebGridColumn>
About how to use ButtonImage column type and assign the image of the button, please find the related article in the WebGrid’s documentation. NewButtonImageColumnType.aspx sample file in WebGrid Samples project (start > All Programs > Intersoft WebUI Studio 2011 R2 SP1 > WebUI Studio for ASP.NET > WebGrid 7 > C# or VB Samples) or check the live sample version in here, can be used for your reference.
I’d like to suggest you to utilize the InitializeRow server side event of WebGrid in order to control visibility of an image button. The snippet code below shows how to set the image button to be invisible if row’s key value is equals to 2 (this code can be tested on NewButtonImageColumnType.aspx sample file).
protected void WebGrid1_InitializeRow(object sender, ISNet.WebUI.WebGrid.RowEventArgs e) { ... if ((int)e.Row.KeyValue == 2) { e.Row.Cells.GetNamedItem("btnInfo").CustomObjectAttributes = "style='display:none'"; } }
... Also can you direct me to documention that describes each server side event on the webgrid? ...
The step by step below will guide you to obtain the documentation which describes each server side event on WebGrid.
Hope this helps.
Thanks!
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