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 have a HyperLink in CellTemplate Column in Webgrid. I need to change the Image (navigateurl image) dynamically on InitializeRow event based on some condition. I tried changing the background image, but it didn't help. Please let me know the soultion for this.
Below is the code
==========
<ISWebGrid:WebGridColumn Caption="Error File" ColumnType="Template" Width="50px" Name="error">
<CellTemplate>
<asp:HyperLink ID="HyperLink1" runat="server" Target="_self" ImageUrl="~/Images/excel_icon.gif"
NavigateUrl='<%# String.Format("/ShowExcelFile.aspx?ID=CONV&File=E&Key={0}&logkey={1}",DataBinder.Eval(Container.DataItem, "aum_yardi_conv_key"),DataBinder.Eval(Container.DataItem, "aum_yardi_con_log_key")) %>'/>
</CellTemplate>
<HeaderStyle CssClass="gridHeadingNumberField" />
<CellStyle CssClass="gridContentTextField" HorizontalAlign="Center"/>
<FooterStyle CssClass="gridContentNumberField" />
</ISWebGrid:WebGridColumn>
In Initialize Event
====================
if (e.Row.Type == RowType.Record) { WebGridCellCollection cells = e.Row.Cells; DataRowView drView = (DataRowView)e.Row.DataRow; int varError = Utility.GetIntegerValue(drView["error_file_length"]);
if (varError == 0) { e.Row.Cells[3].TooltipText = noDataMsg + drView["post_date"].ToString(); e.Row.Cells[3].GetTemplateContainer().BackImageUrl = "<img src='../../../Images/None.gif'/>"; } else { e.Row.Cells[3].TooltipText = "View Error File"; }}
Hi Anitha,
Sorry for late responses. You can change the image by using OnAfterInitialize event on client-side. However we still searching a way to do this matter on server side. I've made a sample for this matter. In my sample, I change the image regarding the value of ContactTitle. Is this method works on your side? Hope this helps.
Regards,Bernard
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