Hi,
This is more of a conceptual questions, rather than a coding question. I would like to double-check my approach to my current issue.
What I want to do:
My current approach
Complicating factor:
Because of this complicating factor, I believe that I need to be creating/adding the Row Item Template programmatically (rather than in markup). I am having some other issues with this (see http://community.infragistics.com/forums/p/60078/305112.aspx). However, my main questions in this post are these:
Regards,
Joel
Thanks for your reply, Tsvetelina, to this forum posting and my other posting. I understand this much better now.
Hello Joel,
Thank you for your interest in WebDataGrid.
This approach is the right way to implement this requirements.
I have replied to the other post.
You can use the WebImageButton to implement the button image column:
private class CustomItemTemplate : ITemplate
{
#region ITemplate Members
public void InstantiateIn(Control container)
CheckBox chkBox = new CheckBox();
chkBox.ID = "TemplateCheckBox";
// Get the cell value from the DataItem
chkBox.Checked = (bool)((DataRowView)((TemplateContainer)container).DataItem)["BoolColumn"];
HyperLink link = new HyperLink();
link.ID = "TemplateHyperLink";
string dataValue = (string)((DataRowView)((TemplateContainer)container).DataItem)["Data"];
link.NavigateUrl = string.Format("http://www.google.bg/search?q={0}", dataValue);
link.Text = (string)((DataRowView)((TemplateContainer)container).DataItem)["Data"];
WebImageButton imgBtn = new WebImageButton();
imgBtn.ID = "TemplateWebImageButton";
imgBtn.CommandArgument = (string)((DataRowView)((TemplateContainer)container).DataItem)["Item"];
imgBtn.Appearance.Image.Url = "~/ig_res/Default/images/add_down.gif";
container.Controls.Add(link);
container.Controls.Add(chkBox);
container.Controls.Add(imgBtn);
}
#endregion
Let me know if you need further assistance