EDN Admin
Well-known member
First off I need to populate the literal when the username comes up. On what event of the grid do I do this.
<pre class="prettyprint <table border="0" cellpadding="0" cellspacing="0" width="100%" class="box
<tr class="boxTop
<td>
<input type="hidden" id="radGridClickedRowIndex" name="radGridClickedRowIndex" />
<telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="SqlDataSourceSnapShot"
GridLines="None" AllowPaging="True" AllowAutomaticUpdates="True" AllowAutomaticInserts="True"
AllowSorting="True" Width="100%" Skin="Windows7" OnItemDataBound="RadGrid1_ItemDataBound"
AutoGenerateColumns="False" OnItemEvent="RadGrid1_ItemEvent"
ondatabound="RadGrid1_DataBound
<PagerStyle Mode="NextPrevAndNumeric" />
<ClientSettings>
<Selecting AllowRowSelect="True </Selecting>
</ClientSettings>
<ClientSettings>
<Selecting CellSelectionMode="None" AllowRowSelect="True </Selecting>
</ClientSettings>
<MasterTableView AllowNaturalSort="false" CommandItemDisplay="Top" AutoGenerateColumns="false"
EnableNoRecordsTemplate="true" ClientDataKeyNames="SnapShotID" ShowHeadersWhenNoRecords="true"
DataSourceID="SqlDataSourceSnapShot" DataKeyNames="SnapShotID
<EditFormSettings>
<EditColumn UniqueName="EditCommandColumn" ButtonType="ImageButton" CancelImageUrl="../Skins/Office2007/Grid/Cancel.gif"
UpdateImageUrl="../Skins/Outlook/Grid/Update.gif" InsertImageUrl="../Skins/Office2007/Grid/Insert.gif
</EditColumn>
</EditFormSettings>
<Columns>
<%--<telerik:GridEditCommandColumn UniqueName="EditCommandColumn" ButtonType="ImageButton"
HeaderStyle-Width="24" EditImageUrl="../Skins/Outlook/Grid/Edit.gif
</telerik:GridEditCommandColumn>--%>
<telerik:GridBoundColumn DataField="SnapShotID" DataType="System.Int32" Visible="false"
FilterControlAltText="Filter SnapShotID column" HeaderText="ID" ReadOnly="True"
SortExpression="SnapShotID" UniqueName="SnapShotID
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="UserName" FilterControlAltText="Filter UserName column"
ReadOnly="true" HeaderText="User Name" SortExpression="UserName" UniqueName="UserName
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="SnapShotName" FilterControlAltText="Filter SnapShotName column"
HeaderText="SnapShotName" SortExpression="SnapShotName" UniqueName="SnapShotName
</telerik:GridBoundColumn>
<telerik:GridBoundColumn Visible="false" DataField="SnapShotTime" DataType="System.DateTime"
FilterControlAltText="Filter SnapShotTime column" HeaderText="SnapShotTime" SortExpression="SnapShotTime"
UniqueName="SnapShotTime
</telerik:GridBoundColumn>
</Columns>
<EditFormSettings EditFormType="Template
<FormTemplate>
<table id="Table2" cellspacing="2" cellpadding="1" width="100%" border="0" rules="none"
style="border-collapse: collapse; background: white;
<tr class="EditFormHeader
<td colspan="4" class="style4
<b>SnapShot Details</b>
</td>
</tr>
<tr class="boxItem
<td colspan="1" class="style3
UserName:
</td>
<td colspan="3
<asp:Literal ID="litUserName" runat="server" Text="N/A </asp:Literal>
</td>
</tr>
<tr class="boxItem
<td colspan="1" class="style3
SnapShot Name:
</td>
<td colspan="3
<asp:TextBox ID="txtSnapShotName" runat="server" Text=<%# DataBinder.Eval( Container, "DataItem.SnapShotName")%> MaxLength="100"
Width="100px" ReadOnly="True" BackColor="#F7F6F3 </asp:TextBox>
</td>
</tr>
<tr>
<td align="right" colspan="2
<asp:Button ID="btnUpdate" Text=<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>
runat="server" CommandName=<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>>
</asp:Button>
<asp:Button ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False"
CommandName="Cancel </asp:Button>
</td>
</tr>
</table>
</FormTemplate>
</EditFormSettings>
</MasterTableView>
<ClientSettings>
<Selecting AllowRowSelect="True </Selecting>
</ClientSettings>
</telerik:RadGrid>
<asp:Label ID="lblCount" runat="server </asp:Label>
<br />
<asp:SqlDataSource ID="SqlDataSourceUnit" runat="server" ConnectionString="<%$ ConnectionStrings:MinotaurConnectionString3 %>"
SelectCommand="SELECT DISTINCT * FROM [Units] </asp:SqlDataSource>
</td>
</tr>
</table>[/code]
<br/><hr class="sig Mathieu Alexandre Cupryk www.omegalove.com
View the full article
<pre class="prettyprint <table border="0" cellpadding="0" cellspacing="0" width="100%" class="box
<tr class="boxTop
<td>
<input type="hidden" id="radGridClickedRowIndex" name="radGridClickedRowIndex" />
<telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="SqlDataSourceSnapShot"
GridLines="None" AllowPaging="True" AllowAutomaticUpdates="True" AllowAutomaticInserts="True"
AllowSorting="True" Width="100%" Skin="Windows7" OnItemDataBound="RadGrid1_ItemDataBound"
AutoGenerateColumns="False" OnItemEvent="RadGrid1_ItemEvent"
ondatabound="RadGrid1_DataBound
<PagerStyle Mode="NextPrevAndNumeric" />
<ClientSettings>
<Selecting AllowRowSelect="True </Selecting>
</ClientSettings>
<ClientSettings>
<Selecting CellSelectionMode="None" AllowRowSelect="True </Selecting>
</ClientSettings>
<MasterTableView AllowNaturalSort="false" CommandItemDisplay="Top" AutoGenerateColumns="false"
EnableNoRecordsTemplate="true" ClientDataKeyNames="SnapShotID" ShowHeadersWhenNoRecords="true"
DataSourceID="SqlDataSourceSnapShot" DataKeyNames="SnapShotID
<EditFormSettings>
<EditColumn UniqueName="EditCommandColumn" ButtonType="ImageButton" CancelImageUrl="../Skins/Office2007/Grid/Cancel.gif"
UpdateImageUrl="../Skins/Outlook/Grid/Update.gif" InsertImageUrl="../Skins/Office2007/Grid/Insert.gif
</EditColumn>
</EditFormSettings>
<Columns>
<%--<telerik:GridEditCommandColumn UniqueName="EditCommandColumn" ButtonType="ImageButton"
HeaderStyle-Width="24" EditImageUrl="../Skins/Outlook/Grid/Edit.gif
</telerik:GridEditCommandColumn>--%>
<telerik:GridBoundColumn DataField="SnapShotID" DataType="System.Int32" Visible="false"
FilterControlAltText="Filter SnapShotID column" HeaderText="ID" ReadOnly="True"
SortExpression="SnapShotID" UniqueName="SnapShotID
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="UserName" FilterControlAltText="Filter UserName column"
ReadOnly="true" HeaderText="User Name" SortExpression="UserName" UniqueName="UserName
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="SnapShotName" FilterControlAltText="Filter SnapShotName column"
HeaderText="SnapShotName" SortExpression="SnapShotName" UniqueName="SnapShotName
</telerik:GridBoundColumn>
<telerik:GridBoundColumn Visible="false" DataField="SnapShotTime" DataType="System.DateTime"
FilterControlAltText="Filter SnapShotTime column" HeaderText="SnapShotTime" SortExpression="SnapShotTime"
UniqueName="SnapShotTime
</telerik:GridBoundColumn>
</Columns>
<EditFormSettings EditFormType="Template
<FormTemplate>
<table id="Table2" cellspacing="2" cellpadding="1" width="100%" border="0" rules="none"
style="border-collapse: collapse; background: white;
<tr class="EditFormHeader
<td colspan="4" class="style4
<b>SnapShot Details</b>
</td>
</tr>
<tr class="boxItem
<td colspan="1" class="style3
UserName:
</td>
<td colspan="3
<asp:Literal ID="litUserName" runat="server" Text="N/A </asp:Literal>
</td>
</tr>
<tr class="boxItem
<td colspan="1" class="style3
SnapShot Name:
</td>
<td colspan="3
<asp:TextBox ID="txtSnapShotName" runat="server" Text=<%# DataBinder.Eval( Container, "DataItem.SnapShotName")%> MaxLength="100"
Width="100px" ReadOnly="True" BackColor="#F7F6F3 </asp:TextBox>
</td>
</tr>
<tr>
<td align="right" colspan="2
<asp:Button ID="btnUpdate" Text=<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>
runat="server" CommandName=<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>>
</asp:Button>
<asp:Button ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False"
CommandName="Cancel </asp:Button>
</td>
</tr>
</table>
</FormTemplate>
</EditFormSettings>
</MasterTableView>
<ClientSettings>
<Selecting AllowRowSelect="True </Selecting>
</ClientSettings>
</telerik:RadGrid>
<asp:Label ID="lblCount" runat="server </asp:Label>
<br />
<asp:SqlDataSource ID="SqlDataSourceUnit" runat="server" ConnectionString="<%$ ConnectionStrings:MinotaurConnectionString3 %>"
SelectCommand="SELECT DISTINCT * FROM [Units] </asp:SqlDataSource>
</td>
</tr>
</table>[/code]
<br/><hr class="sig Mathieu Alexandre Cupryk www.omegalove.com
View the full article