<telerik:RadGrid ID="radCntDets" runat="server" GridLines="None" Width="938px"
AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False"
OnNeedDataSource="radCntDets_OnNeedDataSource"
AllowAutomaticDeletes="True" AllowAutomaticInserts="True" AllowAutomaticUpdates="True"
HorizontalAlign="NotSet"
Font-Size="Small"
OnItemDataBound="radCntDets_ItemDataBound"
OnItemUpdated="radCntDets_ItemUpdated"
OnUpdateCommand="radCntDets_UpdateCommand"
OnInsertCommand="radCntDets_InsertCommand"
OnDeleteCommand="radCntDets_DeleteCommand">
<ClientSettings EnableRowHoverStyle="True">
<ClientEvents OnColumnClick="rowColumnClicked" OnRowClick="rowClick" OnCommand="oncommand" />
<Scrolling AllowScroll="true" UseStaticHeaders="True" />
</ClientSettings>
<MasterTableView GridLines="None" CommandItemDisplay="Top" DataKeyNames="ControlID" EditMode="InPlace">
<CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
<RowIndicatorColumn FilterControlAltText="Filter RowIndicator column"></RowIndicatorColumn>
<ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column"></ExpandCollapseColumn>
<Columns>
<telerik:GridEditCommandColumn UniqueName="EditCommandColumn" ItemStyle-Width="100px" HeaderStyle-Width="100px">
<HeaderStyle Width="100px"></HeaderStyle>
<ItemStyle Width="100px"></ItemStyle>
</telerik:GridEditCommandColumn>
<telerik:GridButtonColumn ConfirmText="Delete this control?" ButtonType="ImageButton"
CommandName="Delete" Text="Delete" UniqueName="DeleteColumn1">
<HeaderStyle Width="20px" />
<ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" />
</telerik:GridButtonColumn>
<telerik:GridTemplateColumn HeaderText="Email Address" UniqueName="EmailAddress" ItemStyle-Width="80px" HeaderStyle-Width="80px">
<ItemTemplate>
<%#DataBinder.Eval(Container.DataItem, "EmailAddress")%>
</ItemTemplate>
<EditItemTemplate>
<%--<asp:TextBox ID="txtEAddress" runat="server" Text='<%# Bind("EmailAddress") %>'></asp:TextBox>--%>
<input id="txtEmails" runat="server" type="text" class="bodyText" width="120px" onchange="return ValidateEmail(this);" />
<asp:RegularExpressionValidator Display="Dynamic" ID="RegularExpressionValidator1" ValidationExpression="^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$"
runat="server" ControlToValidate="txtEmails" ErrorMessage="Valid E-mail address is required.">*</asp:RegularExpressionValidator>
</EditItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridBoundColumn UniqueName="Description" HeaderText="Description" DataField="Description"
HeaderStyle-Width="220px" ItemStyle-Width="220px">
<HeaderStyle Width="220px"></HeaderStyle>
<ItemStyle Width="220px"></ItemStyle>
</telerik:GridBoundColumn>
</Columns>
</MasterTableView>
<FilterMenu EnableImageSprites="False"></FilterMenu>
<HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default"></HeaderContextMenu>
</telerik:RadGrid>
protected void radCntDets_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
{
if (e.Item is GridDataItem)
{
GridDataItem gridItem = e.Item as GridDataItem;
foreach (GridColumn column in radCntDets.MasterTableView.RenderColumns)
{
if (column is GridBoundColumn)
gridItem[column.UniqueName].ToolTip = gridItem[column.UniqueName].Text;
if (column is GridTemplateColumn)
{
// How to get ItemTemplate (EmailAddress) value
}
}
}
}
Thanks in advance for your help.
- Indra
dataGridView1.Rows[0].Selected = true;
string selectedValue = (RadGrid1.SelectedItems[0] as GridDataItem)["users"].Text;
I have a radgrid with a template to edit a pretty big record.
I created the template, added a few fields, edited, saved all is well.
Next I added a tabstrip to the template, created tabs for billing address, mailing address, etc…
Everything looks great but when I try to update the record the information in the tabstrip does not get saved. (None of the tabs)
The few header fields outside of the tabstrip do update fine and no error is generated.
I hope this makes sense.
Thanks for any help.
Bill
<
telerik:RadWindowManager
ID
=
"RadWindowManager1"
runat
=
"server"
Behavior
=
"Minimize, Close, Pin, Move"
Behaviors
=
"Minimize, Close, Pin, Move"
Skin
=
"Outlook"
>
<
Windows
>
<
telerik:RadWindow
ID
=
"SupportWindow"
runat
=
"server"
NavigateUrl
=
"~/ForRadWindows/Support.aspx"
style
=
"display:none;"
Behavior
=
"Close, Pin"
Behaviors
=
"Close, Pin"
Skin
=
"Forest"
>
</
telerik:RadWindow
>
</
Windows
>
</
telerik:RadWindowManager
>
<telerik:RadGrid runat="server" ID="rdGdMain" ShowFooter="False"
AllowSorting="True" GridLines="None">
<MasterTableView AutoGenerateColumns="False" AllowPaging="True" HierarchyLoadMode="serverondemand"
Name="MainGrid">
<NestedViewTemplate>
<asp:Panel runat="server" ID="InnerContainer">
<telerik:RadTabStrip runat="server" ID="tabStrip1" MultiPageID="multiPage1"
SelectedIndex="0">
<Tabs>
<telerik:RadTab runat="server" Text="t1" PageViewID="pageView1">
</telerik:RadTab>
<telerik:RadTab runat="server" Text="Final t2" PageViewID="pageView2">
</telerik:RadTab>
<telerik:RadTab runat="server" Text="t3" PageViewID="pageView3">
</telerik:RadTab>
</Tabs>
</telerik:RadTabStrip>
<telerik:RadMultiPage runat="server" ID="multiPage1" Width="100%">
<telerik:RadPageView runat="server" ID="pageView1"
Selected="true">
<asp:Label ID="lbl1" Text='<%# Eval("id") %>'
Visible="false" runat="server" />
<telerik:RadGrid runat="server" ID="rdGd2" AllowSorting="true"
DataSourceID="myDS"
OnItemCommand
="rdGd2_ItemCommand"
OnItemCreated="rdGd2_ItemCreated" OnItemDataBound="rdGd2_ItemDataBound">
<MasterTableView ShowHeader="true" AutoGenerateColumns="False" AllowPaging="true"
Name="MainGrid" PageSize="10" HierarchyLoadMode="serverondemand" >
<Columns>
.........
</Columns>