RadGrid1.MasterTableView.AutoGeneratedColumns[
"somecol"].HeaderText = "My Column";
| <telerik:RadNumericTextBox ID="txt_open_indemnity" Runat="server" Text='<%# Bind( "paid_indemnity" ) %>' |
| CssClass="style2" Culture="English (United States)" DataType="System.Decimal" |
| TabIndex="8" Type="Currency" Value="0" Width="100px"> |
| </telerik:RadNumericTextBox> |
<telerik:RadWindowManager ID="RadWindowManager1" runat="server">
<Windows>
</Windows>
</telerik:RadWindowManager>
<telerik:RadGrid ID="RadGrid1" runat="server" Skin="Outlook" AutoGenerateColumns="False" OnItemCommand="RadGrid1_ItemCommand"
OnNeedDataSource="RadGrid1_NeedDataSource" OnItemDataBound="RadGrid1_ItemDataBound"
OnInsertCommand="RadGrid1_InsertCommand" OnUpdateCommand="RadGrid1_UpdateCommand"
AllowPaging="True" AllowSorting="True" PageSize="20" GridLines="None">
<MasterTableView Width="100%" CommandItemDisplay="Top" DataKeyNames="Provider_FacilityID"
EditMode="EditForms">
<Columns>
<telerik:GridEditCommandColumn ButtonType="ImageButton" EditImageUrl="../images/icon_edit.gif"
UniqueName="EditCommandColumn">
<HeaderStyle Width="20px" />
</telerik:GridEditCommandColumn>
<telerik:GridBoundColumn UniqueName="provider" HeaderText="Provider" DataField="provider">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn UniqueName="providerStatus" HeaderText="ProviderStatus"
DataField="providerStatus" HtmlEncode="true">
</telerik:GridBoundColumn>
<telerik:GridDateTimeColumn DataField="ProviderFacilityStartDate" HeaderText="Start Date"
DataFormatString="{0:MM/dd/yyyy}" UniqueName="ProviderFacilityStartDate" AutoPostBackOnFilter="true">
</telerik:GridDateTimeColumn>
<telerik:GridDateTimeColumn DataField="ProviderFacilityEndDate" HeaderText="End Date"
DataFormatString="{0:MM/dd/yyyy}" UniqueName="ProviderFacilityEndDate" AutoPostBackOnFilter="true">
</telerik:GridDateTimeColumn>
<telerik:GridBoundColumn UniqueName="workStatus" HeaderText="Facility Rel Status"
DataField="workStatus" HtmlEncode="true">
</telerik:GridBoundColumn>
<telerik:GridDateTimeColumn DataField="PrivilegesGrantedDate" HeaderText="Privileges Granted"
DataFormatString="{0:MM/dd/yyyy}" UniqueName="PrivilegesGrantedDate" AutoPostBackOnFilter="true">
</telerik:GridDateTimeColumn>
<telerik:GridDateTimeColumn DataField="PrivilegesExpiration" HeaderText="Privileges Expiration"
DataFormatString="{0:MM/dd/yyyy}" UniqueName="PrivilegesExpiration" AutoPostBackOnFilter="true">
</telerik:GridDateTimeColumn>
<telerik:GridBoundColumn UniqueName="PrivilegeStatus" HeaderText="Privilege Status"
DataField="PrivilegeStatus" HtmlEncode="true">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn UniqueName="FacilityID" HeaderText="FacilityID" DataField="FacilityID"
HtmlEncode="true" Visible="false">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn UniqueName="ProviderID" HeaderText="ProviderID" DataField="ProviderID"
HtmlEncode="true" Visible="false">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn UniqueName="Provider_FacilityID" HeaderText="Provider_FacilityID"
DataField="Provider_FacilityID" HtmlEncode="true" Visible="false">
</telerik:GridBoundColumn>
<telerik:GridTemplateColumn HeaderText="" UniqueName="changeSeq1">
<ItemTemplate>
<asp:ImageButton ID="relation" runat="server" ImageUrl="~/images/folder-documents.png"
OnClick="relationship_Click" ToolTip="Relationship" />
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn HeaderText="" UniqueName="changeSeq2">
<ItemTemplate>
<asp:ImageButton ID="EnrollForm" runat="server" ImageUrl="~/images/icon_document.gif"
OnClick="enrollmentForm_Click" ToolTip="Enrollment Form" />
</ItemTemplate>
</telerik:GridTemplateColumn>
</Columns>
<EditFormSettings EditFormType="Template">
<EditColumn UniqueName="EditCommandColumn1">
</EditColumn>
<FormTemplate>
<table id="Table2" border="0" cellpadding="1" cellspacing="2" rules="none" style="border-collapse: collapse;
background: white;" width="100%">
<tr valign="top">
<td>
<asp:Panel ID="Panel1" runat="server" GroupingText="Provider Facility Relationship">
<table id="Table3" border="0" cellpadding="1" cellspacing="1" width="100%">
<tr>
<td style="width: 186px" class="td_AEV">
Provider
</td>
<td class="td_AEVNoBold">
<asp:DropDownList ID="drpProvider" runat="server">
</asp:DropDownList>
</td>
</tr>
<tr valign="top">
<td style="width: 186px" class="td_AEV">
Work Status
</td>
<td class="td_AEVNoBold">
<asp:DropDownList ID="WorkStatusID" runat="server" DataSourceID="LinqDataSource1"
DataTextField="Description" DataValueField="WorkStatusID" AppendDataBoundItems="true"
SelectedValue='<%# Bind("WorkStatusID") %>'>
<asp:ListItem Text="" Selected="True" Value=""></asp:ListItem>
</asp:DropDownList>
<span style="color: Red">*</span>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
ControlToValidate="WorkStatusID" ErrorMessage=" Required Field"></asp:RequiredFieldValidator>
<asp:LinqDataSource ID="LinqDataSource1" runat="server" ContextTypeName="HPPInfoNet.Data.hppInfoNet2DataContext"
Select="new (Description, WorkStatusID)" TableName="WorkStatus">
</asp:LinqDataSource>
</td>
</tr>
<tr valign="top">
<td style="width: 186px" class="td_AEV">
Start Date
</td>
<td class="td_AEVNoBold">
<telerik:RadDatePicker ID="ProviderFacilityStartDate" runat="server" DataFormatString="{0:MM/dd/yyyy}">
</telerik:RadDatePicker>
</td>
</tr>
<tr valign="top">
<td style="width: 186px" class="td_AEV">
End Date
</td>
<td class="td_AEVNoBold">
<telerik:RadDatePicker ID="ProviderFacilityEndDate" runat="server" DataFormatString="{0:MM/dd/yyyy}">
</telerik:RadDatePicker>
</td>
</tr>
<tr valign="top">
<td style="width: 186px" class="td_AEV">
Relationship Status
</td>
<td class="td_AEVNoBold">
<asp:DropDownList ID="PhysicianStatusID" runat="server" DataSourceID="LinqDataSource2"
DataTextField="Description" DataValueField="PhysicianStatusID" AppendDataBoundItems="true"
SelectedValue='<%# Bind("PhysicianStatusID") %>'>
<asp:ListItem Text="" Selected="True" Value=""></asp:ListItem>
</asp:DropDownList>
<span style="color: Red">*</span>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
ControlToValidate="PhysicianStatusID" ErrorMessage=" Required Field"
></asp:RequiredFieldValidator>
<asp:LinqDataSource ID="LinqDataSource2" runat="server" ContextTypeName="HPPInfoNet.Data.hppInfoNet2DataContext"
Select="new (Description, PhysicianStatusID)" TableName="PhysicianStatus">
</asp:LinqDataSource>
</td>
</tr>
<tr valign="top">
<td style="width: 186px" class="td_AEV">
Privileges Granted Date
</td>
<td class="td_AEVNoBold">
<telerik:RadDatePicker ID="PrivilegesGrantedDate" runat="server" DataFormatString="{0:MM/dd/yyyy}">
</telerik:RadDatePicker>
</td>
</tr>
<tr valign="top">
<td style="width: 186px" class="td_AEV">
Privileges Expiration Date
</td>
<td class="td_AEVNoBold">
<telerik:RadDatePicker ID="PrivilegesExpiration" runat="server" DataFormatString="{0:MM/dd/yyyy}">
</telerik:RadDatePicker>
</td>
</tr>
<tr valign="top">
<td style="width: 186px" class="td_AEV">
Privileges Status
</td>
<td class="td_AEVNoBold">
<asp:DropDownList ID="PrivilegeStatusID" runat="server" DataSourceID="LinqDataSource3"
DataTextField="Description" DataValueField="PrivilegeStatusID" AppendDataBoundItems="true"
SelectedValue='<%# Bind("PrivilegeStatusID") %>'>
<asp:ListItem Text="---" Selected="True" Value=""></asp:ListItem>
</asp:DropDownList>
<asp:LinqDataSource ID="LinqDataSource3" runat="server" ContextTypeName="HPPInfoNet.Data.hppInfoNet2DataContext"
Select="new (Description, PrivilegeStatusID)" TableName="PrivilegeStatus">
</asp:LinqDataSource>
</td>
</tr>
<tr>
<td style="width: 186px" class="td_AEV">
</td>
<td align="left" class="td_AEVNoBold">
<asp:Button ID="Button3" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>'
runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'>
</asp:Button>
<asp:Button ID="Button4" Text="Cancel" runat="server" CausesValidation="False" CommandName="Cancel">
</asp:Button>
</td>
</tr>
</table>
</asp:Panel>
</td>
</tr>
</table>
</FormTemplate>
</EditFormSettings>
</MasterTableView>
</telerik:RadGrid>
</code>
Here is my code-behind:
<code>
protected void relationship_Click(object sender, ImageClickEventArgs e)
{
RadWindowManager1.Windows.Clear();
RadWindow newwindow = new RadWindow();
newwindow.ID = "RadWindow1"; //"RadWindow1";
newwindow.Width = 1000;
newwindow.Height = 600;
newwindow.Modal = true;
newwindow.VisibleOnPageLoad = true;
newwindow.DestroyOnClose = true;
newwindow.NavigateUrl = "../relationship/prvFacRelationship.aspx?usrname=" + ViewState["UserName"].ToString() + "&usremail=" + ViewState["UserEmail"].ToString() + "&pfID=" + pfID;
RadWindowManager1.Windows.Add(newwindow);
}
| <asp:ObjectDataSource ID="dsEmplTable" runat="server" DataObjectTypeName="TableObjects.EmplTable" |
| TypeName="TableObjects.EmplTableAdapter" DeleteMethod="DeleteEmplTable" |
| InsertMethod="InsertEmplTable" SelectMethod="SelectEmplTable" UpdateMethod="UpdateEmplTable" |
| OldValuesParameterFormatString="original_{0}" EnableCaching="true" CacheDuration="10" |
| SortParameterName="sortExpression" SelectCountMethod="SelectCount" |
| EnablePaging="true" StartRowIndexParameterName="startRow" MaximumRowsParameterName="pageSize" |
| > |
| [DataObjectMethod(DataObjectMethodType.Select, true)] |
| public EmplTableList SelectEmplTable(string sortExpression, int startRow, int pageSize) |
| { |
| //If we use RadComboBox then the values of the startRow and the pageSize variables are 0 |
| //If we use RadGrid then these parameters filled properly by default |
| //Here we want select only a range of employees from a tons of employee |
| DataAccessLayer.GetEmployees(emplTableCollection, startRow, pageSize); |
| SelectCount = emplTableCollection.Count; |
| _empltableData = empltableCollection; |
| return _empltableData; |
| } |
| public int SelectCountEmplTable() |
| { |
| return SelectCount; |
| } |
| <telerik:RadComboBox runat="server" ID="RadComboBox2" DataTextField="EmplId" |
| DataValueField="EmplId" HighlightTemplatedItems="true" Height="190px" Width="220px" |
| DropDownWidth="420px" DataSourceID="dsEmplTable" EnableVirtualScrolling="true" |
| EnableAutomaticLoadOnDemand="True" ItemsPerRequest="10" ShowMoreResultsBox="true" |
| OnItemsRequested="RadComboBox2_ItemRequested" |
| OnItemDataBound="RadComboBox2_ItemDataBound" |
| OnSelectedIndexChanged="RadComboBox2_SelectedIndexChanged" |
| OnDataBinding="RadComboBox2_DataBinding" |
| > |
| <HeaderTemplate> |
| <ul> |
| <li class="col1">Employee Id</li> |
| </ul> |
| </HeaderTemplate> |
| <ItemTemplate> |
| <ul> |
| <li class="col1"><%# DataBinder.Eval(Container.DataItem, "EmplId") %></li> |
| </ul> |
| </ItemTemplate> |
| </telerik:RadComboBox> |
| protected void Page_Load(object sender, EventArgs e) |
| { |
| this.dsEmplTable.Selecting += new ObjectDataSourceSelectingEventHandler(dsEmplTable_Selecting); |
| if (Session["RADCOMBOBOX2_STARTROW"] == null) |
| { |
| Session.Add("RADCOMBOBOX2_STARTROW", 1); |
| } |
| } |
| void dsEmplTable_Selecting(object sender, ObjectDataSourceSelectingEventArgs e) |
| { |
| e.Arguments.StartRowIndex = (int)Session["RADCOMBOBOX2_STARTROW"]; |
| e.Arguments.MaximumRows = (int)Session["RADCOMBOBOX2_MAXIMUMROWS"]; |
| } |