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 am using "Template" columnType inside my Webgrid. If i use asp:LinkButton inside a Template, can you tell me how can access that control from the backend. Here i want to initialize the field as what i did with Hyperlink column type as shown below
WebGrid1.RootTable.Columns(1).HyperlinkFormatString = "displaymap.aspx?id=" + "{0}"
thanks and regards
ca
Hi Ca,
You will need to use FindControl method.
e.g I am using a label named as "Label1" in a WebGridColumn.
Here is how I access the control and set the text:
protected void WebGrid1_InitializeRow(object sender, ISNet.WebUI.WebGrid.RowEventArgs e) { Label a= (Label) e.Row.Cells[4].GetTemplateContainer().FindControl("Label1"); a.Text = "aaa"; }
Regards,Handy
As far as I know, we cannot use HyperLinkFormatString property to set the asp link button control. You can simply set the NavigateUrl in your template instead of set them in the serverside.
The HyperLinkFormatString can only be used when the column type is set to Hypelink. I hope it helps. Thank you and have a nice day.
Best Regards,
Andi Santoso
sorry for the mis understanding made on the question.
i know it is not possible to use HyperLinkFormatString property to asp button control.
by the above line of code i mean, i want to access the property of asp.net control used inside the template column type.
<ISWebGrid:WebGridColumn Caption="View Details" ColumnType="Template" DataMember="L_ID" Name="WebGridColumn11" Width="110px"> <CellTemplate> <asp:ImageButton ID="btndet" CssClass="example7" runat="server" Text="View Details" ImageUrl="~/Images/vdetails.png" /> </CellTemplate> </ISWebGrid:WebGridColumn>
Here how can i assign CssClass property from the backend exactly as i did it for HyperlinkFormatString property of hyperlink control.
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