Ask a Question related to ASP.NET Building Controls, Design and Development.
-
mitramay@gmail.com #1
Dynamic control creation in datagrid based on data in that column
I am creating a dynamic datagrid. The controls in some of the template
columns will have to be generated based on the data contained in them
(i.e. the data for that respective DataField column). For example, if I
have a column called Available, the possible values for it are Yes or
No. In case it is "Yes" I need a label in that column and in case it is
"No" I need a hyperlink. Pls help.
mitramay@gmail.com Guest
-
Dynamic Template column in DataGrid control
Hi Everybody, I am trying to create a dynamic template column in a datagri control using the ITemplate interface. //part of my code in the... -
Move bound column to right of dynamic column in datagrid?
I have a datatable that I am binding to a C# ASP.NET 1.1 web page. I also want to put an "Edit" column on the datagrid. However, whenever I use... -
Dynamic Control Creation with Reflection?
I have a DataTable with String-typed columns that looks like this: "TextBox" "txtTest" "Enter Here" Strictly programmtically in my... -
Dynamic Template Column Sorting in DataGrid control
Hi, am facing a problem while using ASP.NET Datagrid Template Columns generated dynamically. Scenario: ------------- 1) I have a custom... -
Dynamic Control Creation w/Events?
I have an ASP.NET web page in which consists of one panel object named pnlTest. In the Page_Load event I'm adding buttons dynamically like so: ... -
Gaurav Vaish \(www.EduJiniOnline.com\) #2
Re: Dynamic control creation in datagrid based on data in that column
> have a column called Available, the possible values for it are Yes or
<ItemTemplate>> No. In case it is "Yes" I need a label in that column and in case it is
>
> "No" I need a hyperlink. Pls help.
<asp:Label ID='lbl' ... />
<asp:LinkButton ID='lbtn' .../>
</ItemTemplate>
dataGrid1.ItemCreated += dataGrid1_ItemCreated;
void dataGrid1_ItemCreated(...)
{
DataGridItem item = e.Item;
Control labelControl = item.FindControl("lbl");
Control lbtnControl = item.FindControl("lbtn");
if(toShowLabel)
{
labelControl.Visible = true;
lbtnControl.Visible = false;
} else
{
labelControl.Visible = false;
lbtnControl.Visible = true;
}
}
HTH
--
Happy Hacking,
Gaurav Vaish | [url]http://www.mastergaurav.com[/url]
[url]http://www.edujinionline.com[/url]
[url]http://articles.edujinionline.com/webservices[/url]
-------------------
Gaurav Vaish \(www.EduJiniOnline.com\) Guest



Reply With Quote

