I have a price field in my grid which is an item template column and the item template and the edit template are both radnumeric textboxes. As part of my URL, I have a querystring telling me if the price is yes(editable), readonly(only show on grid but not in edit form) or no(dont show anywhere).
Here is the aspx:
<telerik:GridTemplateColumn HeaderText="Package Price" UniqueName="NumericPrice" AllowFiltering="false">
<ItemTemplate>
<telerik:RadNumericTextBox ID="inGridPkgPrice" runat="server" Price='<%# Eval("packageprice") %>'
Culture="English (United States)" Type="Currency" DbValue='<%# DataBinder.Eval(Container.DataItem, "packageprice") %>'
Width="125px" OnTextChanged="RadNumericInlineGridTextChanged" AutoPostBack= "true">
</telerik:RadNumericTextBox>
</ItemTemplate>
<EditItemTemplate>
<telerik:RadNumericTextBox ID="inFormPkgPrice" runat="server" Price='<%# Eval("packageprice") %>'
Culture="English (United States)" Type="Currency" DbValue='<%# DataBinder.Eval(Container.DataItem, "packageprice") %>'
Width="125px" OnTextChanged="RadNumericDefaultPackageTextChanged">
<ClientEvents OnLoad="PriceBoxLoad" />
</telerik:RadNumericTextBox>
</EditItemTemplate>
I have it inline editable in the grid,and if if is readonly, I was able to make the item template price .readonly = true, and just put a tooltip saying it is readonly so they dont try to edit it. Here is that code which works fine:
protected void usersGrid_PreRender(object sender, EventArgs e)
{
foreach (GridDataItem item in usersGrid.Items)
{
if (Request.QueryString["price"] == "readonly")
{
RadNumericTextBox txtboxPrice = (RadNumericTextBox)item["NumericPrice"].FindControl("inGridPkgPrice");
txtboxPrice.ReadOnly = true;
txtboxPrice.ToolTip = "This field is readonly";
}
}
}
My question is, since the edititem is a radnumerictextbox, I just want to make it not visible in the edit form if is is readonly but don't know how or where.
Where would I put the code to make it not visible in the insert/edit form and what would that code be?
Thanks
Here is the aspx:
<telerik:GridTemplateColumn HeaderText="Package Price" UniqueName="NumericPrice" AllowFiltering="false">
<ItemTemplate>
<telerik:RadNumericTextBox ID="inGridPkgPrice" runat="server" Price='<%# Eval("packageprice") %>'
Culture="English (United States)" Type="Currency" DbValue='<%# DataBinder.Eval(Container.DataItem, "packageprice") %>'
Width="125px" OnTextChanged="RadNumericInlineGridTextChanged" AutoPostBack= "true">
</telerik:RadNumericTextBox>
</ItemTemplate>
<EditItemTemplate>
<telerik:RadNumericTextBox ID="inFormPkgPrice" runat="server" Price='<%# Eval("packageprice") %>'
Culture="English (United States)" Type="Currency" DbValue='<%# DataBinder.Eval(Container.DataItem, "packageprice") %>'
Width="125px" OnTextChanged="RadNumericDefaultPackageTextChanged">
<ClientEvents OnLoad="PriceBoxLoad" />
</telerik:RadNumericTextBox>
</EditItemTemplate>
I have it inline editable in the grid,and if if is readonly, I was able to make the item template price .readonly = true, and just put a tooltip saying it is readonly so they dont try to edit it. Here is that code which works fine:
protected void usersGrid_PreRender(object sender, EventArgs e)
{
foreach (GridDataItem item in usersGrid.Items)
{
if (Request.QueryString["price"] == "readonly")
{
RadNumericTextBox txtboxPrice = (RadNumericTextBox)item["NumericPrice"].FindControl("inGridPkgPrice");
txtboxPrice.ReadOnly = true;
txtboxPrice.ToolTip = "This field is readonly";
}
}
}
My question is, since the edititem is a radnumerictextbox, I just want to make it not visible in the edit form if is is readonly but don't know how or where.
Where would I put the code to make it not visible in the insert/edit form and what would that code be?
Thanks