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
My cell is set to "image" The following code constructs and formats the image properly; however it does not show in the cell.
Dim Otext As String = "<img src=" Dim wText As String = " width=" + """" + "200px" + """" Dim hText As String = " height=" + """" + "82px" + """" Dim CText As String = " />" Protected Sub WebGrid1_InitializeRow(sender As Object, e As ISNet.WebUI.WebGrid.RowEventArgs) Handles WebGrid1.InitializeRow WebGrid1.RootTable.Columns.GetNamedItem("ImageShow").CellImage = Otext + " """ + e.Row.Cells(3).Text + """ " + wText + hText '+ CText WebGrid1.RootTable.Columns(2).MaxHeight = Unit.Pixel(82) 'Response.Write(Otext + " """ + e.Row.Cells(3).Text + """ " + wText + hText + CText) End Sub
What am I doing wrong?
Protected Sub WebGrid1_InitializeRow(ByVal sender As Object, ByVal e As ISNet.WebUI.WebGrid.RowEventArgs) If e.Row.Type = ISNet.WebUI.WebGrid.RowType.Record Then Dim customerID As WebGridCell = e.Row.Cells.GetNamedItem("CustomerID") customerID.Image = "http://gkfahnbulleh-001-site16.smarterasp.net/content/media/00coverimages/dahlgren4.jpg" customerID.CustomObjectAttributes = "height=82 width=200" End If End Sub
The above snippet code should do the trick. Please let us know if you have different result.
The CellImage property gets or sets the image file name that will be displayed in cells that belong to a column. Simply set this property with the image file name such as shown in the following snippet code.
Example: Set CellImage property in aspx page.
<ISWebGrid:WebGridColumn Caption="CustomerID" DataMember="CustomerID" Name="CustomerID" Width="120px" ColumnType="ImageAndText" CellImage="images/user.gif"> </ISWebGrid:WebGridColumn>
Example: Set CellImage property in code behind (vb).
Protected Sub WebGrid1_InitializeRow(ByVal sender As Object, ByVal e As ISNet.WebUI.WebGrid.RowEventArgs) WebGrid1.RootTable.Columns.GetNamedItem("CustomerID").CellImage = "images/user2.gif" ' Alternatively can use following snippet to set the cell image 'If e.Row.Type = ISNet.WebUI.WebGrid.RowType.Record Then ' e.Row.Cells.GetNamedItem("CustomerID").Image = "images/user2.gif" 'End If End Sub
For more detail, please check the code behind in FirstExperience.aspx sample and NewButtonImageColumnType.aspx sample.
This should help.
WebGrid has ButtonImage column type which may suit with your scenario, to put the image in an ImageButton. The following screenshot shows a WebGrid using ButtonImage column type in the first column.
The ButtonImage column type takes advantage of existing architecture such as ButtonAutoPostback property and ButtonPostbackMode property. The ButtonClick client side event is invoked as well for ButtonImage column type.
The sample ButtonImage definition in WebGridColumn is as following:
<ISWebGrid:WebGridColumn Width="30px" ColumnType="ButtonImage" ButtonImage="images/info.gif" ButtonAutoPostback="true"> </ISWebGrid:WebGridColumn>
Hope this helps.
Could you please provide me with more detail information about which editor specified on the WebGridColumn object and the step-by-step to reproduce the reported problem? A working simple sample will helps much.
Look forward to hearing back from you.
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