I have a radgrid that binds an object stored in the ViewState (Case). When I click on the radgrid's "Add" button (firing the OnInsertCommand) I get the following error: 'Telerik.Web.UI.GridInsertionObject' does not contain a property with the name 'LookupValue'.' The specific control I am having problems with is the RadDropDownTree, and only when its definition contains this "SelectedValue='<%# Bind("LookupValue.Code") %>'"
I do not understand why this is happening. What is so different now that my radgrid is binding to a object that contains a subobject?? What do I need to be doing differently?
Just as an fyi, I do not get this error when the OnUpdateCommand fires. Below is my code.
<telerik:RadGrid ID="gvAllegations" runat="server"
AllowAutomaticDeletes="false"
AllowAutomaticInserts="false"
AllowAutomaticUpdates="false"
AllowFilteringByColumn="false"
AllowMultiRowEdit="false"
AllowMultiRowSelection="false"
AllowPaging="false"
AllowSorting="false"
AutoGenerateColumns="false"
OnNeedDataSource="gvAllegations_NeedDataSource"
OnInsertCommand="gvAllegations_InsertCommand"
OnUpdateCommand="gvAllegations_UpdateCommand">
<ClientSettings Selecting-AllowRowSelect="true" />
<GroupingSettings CaseSensitive="false" />
<MasterTableView
CommandItemDisplay="Top"
DataKeyNames="CaseAllegationID"
ClientDataKeyNames="CaseAllegationID">
<Columns>
<telerik:GridBoundColumn UniqueName="AllegationType" DataField="Type" HeaderText="Type" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" />
<telerik:GridBoundColumn UniqueName="AllegationCodeDescription" DataField="LookupValue.CodeDescription" HeaderText="Allegation" />
</Columns>
<CommandItemTemplate>
<div class="CommandButtonDiv">
<asp:LinkButton ID="LinkButton2" runat="server"
CssClass="CommandButton"
CommandName="InitInsert"
Visible='<%# !gvAllegations.MasterTableView.IsItemInserted && gvAllegations.EditIndexes.Count == 0 %>'>
<img src="Images/AddRecord.png"/> Add
</asp:LinkButton>
<asp:LinkButton ID="btnEditSelected" runat="server"
CssClass="CommandButton"
CommandName="EditSelected"
Visible='<%# !gvAllegations.MasterTableView.IsItemInserted && gvAllegations.EditIndexes.Count == 0 %>'>
<img src="Images/Edit.png" /> Edit
</asp:LinkButton>
<asp:LinkButton ID="LinkButton1" runat="server"
CssClass="CommandButton"
CommandName="DeleteSelected"
Visible='<%# !gvAllegations.MasterTableView.IsItemInserted && gvAllegations.EditIndexes.Count == 0 %>'>
<img src="Images/Delete.png"/> Delete
</asp:LinkButton>
<asp:LinkButton ID="LinkButton4" runat="server"
CssClass="CommandButton"
CommandName="RebindGrid"
Visible='<%# !gvAllegations.MasterTableView.IsItemInserted && gvAllegations.EditIndexes.Count == 0 %>'>
<img src="Images/Refresh.png"/> Refresh
</asp:LinkButton>
<asp:LinkButton ID="LinkButton3" runat="server"
CssClass="CommandButton"
CommandName="PerformInsert" Visible='<%# gvAllegations.MasterTableView.IsItemInserted %>'>
<img src="Images/Insert.gif"/> Save
</asp:LinkButton>
<asp:LinkButton ID="LinkButton5" runat="server"
CssClass="CommandButton"
CommandName="UpdateEdited" Visible='<%# gvAllegations.EditIndexes.Count > 0 %>'>
<img src="Images/Update.png"/> Update
</asp:LinkButton>
<asp:LinkButton ID="btnCancel" runat="server"
CssClass="CommandButton"
CommandName="CancelAll" Visible='<%# gvAllegations.MasterTableView.IsItemInserted || gvAllegations.EditIndexes.Count > 0 %>'>
<img src="Images/Cancel.png"/> Cancel
</asp:LinkButton>
</div>
</CommandItemTemplate>
<EditFormSettings EditFormType="Template">
<FormTemplate>
<table style="width: 100%">
<tr>
<td>Allegation</td>
<td>
<telerik:RadDropDownTree ID="ddtAllegation" runat="server"
AutoPostBack="False"
DataFieldId="Code"
DataFieldParentID="ParentCode"
DataValueField="Code"
DataSourceID="odsAllegationLookupValues"
DataTextField="CodeDescription"
EnableFiltering="True"
ExpandNodeOnSingleClick="True"
SelectedValue='<%# Bind("LookupValue.Code") %>'
Width="300px">
<DropDownSettings AutoWidth="Enabled" CloseDropDownOnSelection="true" />
<FilterSettings EmptyMessage="Search Allegation" Filter="Contains" Highlight="Matches" />
</telerik:RadDropDownTree>
</td>
</tr>
<tr>
<td>Major Allegation</td>
<td><telerik:RadCheckBox ID="chbMajorAllegation" runat="server"
AutoPostBack="False" Checked='<%# Bind("IsMajor") %>' /></td>
</tr>
<tr>
<td colspan="2" style="text-align: center">
<telerik:RadButton ID="btnInsert" runat="server"
CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'
Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>'
Width="100px" />
<telerik:RadButton ID="btnCancel" runat="server"
Text="Cancel"
CommandName="Cancel"
Width="100px" />
</td>
</tr>
</table>
</FormTemplate>
</EditFormSettings>
</MasterTableView>
</telerik:RadGrid>
[Serializable]
public class Case
{
public int ID { get; set; }
public List<Allegation> Allegations { get; set; }
}
[Serializable]
public class Allegation
{
public int CaseAllegationID { get; set; }
public bool IsMajor { get; set; }
public string Type
{
get
{
if (IsMajor)
return "Major";
else
return "Other";
}
}
public LookupValue LookupValue { get; set; }
}
[Serializable]
public class LookupValue
{
public string Code { get; set; }
public string Description { get; set; }
public string CodeDescription { get { return Code + " - " + Description; } }
public string ParentCode { get; set; }
public int DimID { get; set; }
public DateTime DimStartDate { get; set; }
public DateTime DimEndDate { get; set; }
public bool DimIsActive { get; set; }
} protected void gvAllegations_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
{
gvAllegations.DataSource = ((Case)ViewState["rcaCase"]).Allegations;
}
protected void gvAllegations_InsertCommand(object sender, GridCommandEventArgs e)
{
}Good morning ,
I have a datagrid in my project and for some reason one column does not exporting to excel spreadhseet.
The column name is called 'Location'
Please see my html:
telerik:RadGrid ID="EmplReqGrid" runat="server" Skin="Simple"
GridLines="None" AllowPaging="true" AllowSorting="true"
onexcelmlexportrowcreated="EmplReqGrid_ExcelMLExportRowCreated"
onexcelmlexportstylescreated="EmplReqGrid_ExcelMLExportStylesCreated"
onitemcommand="EmplReqGrid_ItemCommand" onitemcreated="EmplReqGrid_ItemCreated"
onitemdatabound="EmplReqGrid_ItemDataBound"
onneeddatasource="EmplReqGrid_NeedDataSource"
onpageindexchanged="EmplReqGrid_PageIndexChanged"
onpagesizechanged="EmplReqGrid_PageSizeChanged"
onpdfexporting="EmplReqGrid_PdfExporting"
onsortcommand="EmplReqGrid_SortCommand" >
<ExportSettings FileName="EmplReqRpt" OpenInNewWindow="true" IgnorePaging="true" ExportOnlyData="true">
<Excel Format="ExcelML" FileExtension="xls"/>
<Pdf FontType="Subset" PaperSize="letter" />
</ExportSettings>
<MasterTableView AutoGenerateColumns="false" AllowMultiColumnSorting="true" >
<HeaderStyle Font-Names="Arial" BackColor="#3974AE" ForeColor="White" Font-Size="Small" />
<Columns>
<telerik:GridBoundColumn HeaderText="Eis-Id" DataField="PRI" UniqueName="PRI" ReadOnly="True" SortExpression="PRI" HeaderButtonType="TextButton" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" >
</telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="Name" DataField="NAME" UniqueName="NAME" Display="false" ></telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="ReqNo" DataField="TRKNO" UniqueName="TRKNO" ReadOnly="True" SortExpression="TRKNO" HeaderButtonType="TextButton" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" >
</telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="Job" DataField="JOB" UniqueName="JOB" ReadOnly="True" SortExpression="JOB" HeaderButtonType="TextButton" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" >
</telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="Location" DataField="LOC" UniqueName="LOC" HeaderButtonType="TextButton" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" ReadOnly="true" SortExpression="LOC" >
</telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="Term" DataField="TERMID" UniqueName="TERMID" ReadOnly="True" SortExpression="TERMID" HeaderButtonType="TextButton" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="Start Date" DataField="TERMST" UniqueName="TERMST" ReadOnly="true" DataFormatString="{0:MM/dd/yyyy}" SortExpression="TERMST" HeaderButtonType="TextButton" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="End Date" DataField="TERMEND" UniqueName="TERMEND" ReadOnly="true" DataFormatString="{0:MM/dd/yyyy}" SortExpression="TERMEND" HeaderButtonType="TextButton" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="No of Days" DataField="NUMP" UniqueName="NUMP" ReadOnly="True" SortExpression="NUMP" HeaderButtonType="TextButton" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="Process Status" DataField="APPRFLAG" UniqueName="APPRFLAG" ReadOnly="True" SortExpression="APPRFLAG" HeaderButtonType="TextButton" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="Rec Status" DataField="STATUS" UniqueName="STATUS" ReadOnly="True" SortExpression="STATUS" HeaderButtonType="TextButton" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="Process Status Date" DataField="FORMDATE" UniqueName="FORMDATE" ReadOnly="True" DataFormatString="{0:MM/dd/yyyy}" SortExpression="FORMDATE" HeaderButtonType="TextButton" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="REQFLAG" UniqueName="REQFLAG" Display="false"></telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="SENDFLAG" UniqueName="SENDFLAG" Display="false"></telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="BEG_FALL" UniqueName="BEG_FALL" Display="false"></telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="END_FALL" UniqueName="END_FALL" Display="false"></telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="BEG_SPRING" UniqueName="BEG_SPRING" Display="false"></telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="END_SPRING" UniqueName="END_SPRING" Display="false"></telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="BEG_ALL" UniqueName="BEG_ALL" Display="false"></telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="END_ALL" UniqueName="END_ALL" Display="false"></telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="TRKSEQ" UniqueName="TRKSEQ" Display="false"></telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="FLAG" UniqueName="FLAG" Display="false"></telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="SCHEDULE" UniqueName="SCHEDULE" Display="false"></telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="UPDFLAG " UniqueName="UPDFLAG" Display="false"></telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="GALFLAG" UniqueName="GALFLAG" Display="false"></telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="LIC_DESCR" UniqueName="LIC_DESCR" Display="false"></telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="HSIND" UniqueName="HSIND" Display="false"></telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="CFN" UniqueName="CFN" Display="false"></telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="APPRNAME" UniqueName="APPRNAME" Display="false"></telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="APPREMAIL" UniqueName="APPREMAIL" Display="false"></telerik:GridBoundColumn>
<telerik:GridTemplateColumn HeaderText="Link to Form" UniqueName="ButtonColumn" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Left" HeaderStyle-Width="150px" >
<ItemTemplate>
<asp:ImageButton ID="ReqFormBtn" ImageUrl="~/Image/update.jpg"
BackColor="#5A8EC1"
ToolTip="update,re-submit or print the request" runat="server" CommandName="Redirect" Width="18px" Height="18px" Visible="false" />
<asp:ImageButton ID="ApprFormBtn" ImageUrl="~/Image/Appr_Button.jpg" BackColor="#5A8EC1"
ToolTip="approve/disapprove request" runat="server" CommandName="Approve" Width="18px" Height="18px" ImageAlign="TextTop" Visible="false" />
<asp:Image ID="Image1" runat="server" ToolTip="HR REQUEST" ImageUrl="~/Image/HR_Request3.jpg" Width="12px" Height="12px" Visible="false" />
<%--<asp:ImageButton ID="CancelReqBtn" ImageUrl="~/Image/Cancel_button6.png" runat="server" CommandName="Cancel" ImageAlign="Right" BackColor="Transparent" ToolTip="cancel the request" Width="50px" Height="20px" Visible="false" OnClientClick="ConfirmCancel(value);" />--%>
<asp:ImageButton ID="GalaxyGBtn" runat="server" ImageUrl="~/Image/Galaxy.png" Width="18px" Height="18px" BackColor="#BDCBDE" ToolTip="galaxy generated/updated request" CommandName="GalaxyRequest" Visible="false" />
<asp:ImageButton ID="PlaceHolderBtn" runat="server" ImageUrl="~/Image/PlaceHolder.jpg" Width="17px" Height="17px" ToolTip="placeholder must be budgeted" Visible="false" BackColor="#BDCBDE" CommandName="PlaceHolderRequest" />
<asp:ImageButton ID="HistoryBtn" runat="server" ImageUrl="~/Image/HistoryReq.png" Width="20px" Height="20px" ToolTip="Archive" BackColor="#BDCBDE" Visible="false" CommandName="HistoryRequest" />
</ItemTemplate>
</telerik:GridTemplateColumn>
</Columns>
</MasterTableView>
<ClientSettings EnableRowHoverStyle="True" EnablePostBackOnRowClick = "false">
<Selecting AllowRowSelect="false" />
</ClientSettings>
</telerik:RadGrid>
And here is event which do exporting:
protected void ExporttoExcel_Click1(object sender, ImageClickEventArgs e)
{
try
{
if (!IsPostBack)
return;
RadGrid ReqInfoGrid = (RadGrid)EmpReqReport.FindItemByValue("EmployeeData").FindControl("EmplReqGrid");
ReqInfoGrid.DataSource = Session["dtGrid"];
ReqInfoGrid.DataBind();
ReqInfoGrid.MasterTableView.GetColumn("NAME").Display = true;
ReqInfoGrid.MasterTableView.ExportToExcel();
}
catch (Exception ex)
{
throw;
}
}
Please help me to resolve this issue.
thanks.
Vitaly.

Hi.
I've read all the previous questions on this but still cannot get it to work.
I need the editor content area to be full width in the page.
Is this possible please?
No other css is affecting this - please see the attached image.
Thanks, Jon
I was wondering how to order just uploaded images order by uploaded date?
There are lots of image in the uploaded folder, once uploaded, it's hard for user to find the image they just uploaded, is there a easy way to order all the images by date uploaded?
Many thanks
Hello!
I was wondering, is it possible to change the icons of the export button in the footer of the radgrid? (Xls, pdf and csv).
I tried modifying their CSS classes, but did not work.
Thanks!
*** Thread created by Telerik by Progress staff ***
*** Please follow-up with additional details, if necessary. Thank you. ***
I've recently able to finally got this upgraded and are now in the same versions between the 3 dlls. Please see what you can recommend how I can fix the issue below. The one on the left is the upgrade version. Please notice that there's no border around the drop down.
I have the following in the config (not complete but just related to Telerik and I've also changed to Default in the Telerik.Skin to no avail):
<add key="Telerik.Skin" value="Windows7" />
<add key="Telerik.ScriptManager.TelerikCdn" value="Enabled" />
<add key="Telerik.StyleSheetManager.TelerikCdn" value="Enabled" />
<httpHandlers>
<add path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler" verb="*" validate="false" />
<add path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler" verb="*" validate="false" />
<add path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler" verb="*" validate="false" />
<add path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler" verb="*" validate="false" />
<add path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" validate="false" />
</httpHandlers>
<httpModules>
<add name="RadUploadModule" type="Telerik.Web.UI.RadUploadHttpModule" />
<add name="RadCompression" type="Telerik.Web.UI.RadCompression" />
</httpModules>
<sessionState timeout="180" />
</system.web>
<modules runAllManagedModulesForAllRequests="true">
<remove name="RadUploadModule" />
<add name="RadUploadModule" type="Telerik.Web.UI.RadUploadHttpModule" preCondition="integratedMode" />
<remove name="RadCompression" />
<add name="RadCompression" type="Telerik.Web.UI.RadCompression" preCondition="integratedMode" />
</modules>
<handlers>
<remove name="ChartImage_axd" />
<add name="ChartImage_axd" path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler" verb="*" preCondition="integratedMode" />
<remove name="Telerik_Web_UI_SpellCheckHandler_axd" />
<add name="Telerik_Web_UI_SpellCheckHandler_axd" path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler" verb="*" preCondition="integratedMode" />
<remove name="Telerik_Web_UI_DialogHandler_aspx" />
<add name="Telerik_Web_UI_DialogHandler_aspx" path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler" verb="*" preCondition="integratedMode" />
<remove name="Telerik_RadUploadProgressHandler_ashx" />
<add name="Telerik_RadUploadProgressHandler_ashx" path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler" verb="*" preCondition="integratedMode" />
<remove name="Telerik_Web_UI_WebResource_axd" />
<add name="Telerik_Web_UI_WebResource_axd" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" preCondition="integratedMode" />
</handlers>
</system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Telerik.Web.UI" publicKeyToken="121fae78165ba3d4" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2011.2.712.35" newVersion="2011.2.712.35" />
</dependentAssembly>
</assemblyBinding>
</runtime>
Thank you very much for your time!

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Linq.aspx.vb" Inherits="CreatePAth.Linq" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
<script type="text/javascript">
function stopPostBack() {
return true;
}
function openAssayErrors() {
var wnd = $find("<%=winAssayErrors.ClientID%>");
wnd.show();
return false;
}
function closeAssayErrors() {
var wnd = $find("<%=winAssayErrors.ClientID%>");
wnd.close();
return false;
}
function RefreshParentPage() {
document.location.reload();
}
function stopPostback() {
return true;
}
</script>
</telerik:RadCodeBlock>
</head>
<body>
<form id="form1" runat="server">
<div>
<telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager>
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="btnCloseWinx">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadGrid1" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="btnSelectComment">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="btnSelectComment" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="bAssayErrors">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="bAssayErrors" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
<telerik:RadGrid ID="RadGrid1" AllowAutomaticUpdates="True"
RenderMode="Lightweight" runat="server" AllowSorting="True" ShowStatusBar="true" AutoGenerateColumns="False"
EnableHeaderContextMenu="True"
Height="220"
ViewStateMode="Enabled"
EnableViewState="true">
<ClientSettings>
<Scrolling AllowScroll="true" FrozenColumnsCount="14" SaveScrollPosition="true" UseStaticHeaders="true" />
</ClientSettings>
<MasterTableView HeaderStyle-ForeColor="White" EnableColumnsViewState="false" AllowAutomaticUpdates="true" AllowSorting="True" EnableLinqGrouping="False" GroupsDefaultExpanded="False" Width="100%" TableLayout="fixed" DataKeyNames="Item, ErrorSamples">
<Columns>
<telerik:GridBoundColumn DataField="Item" FilterControlAltText="Item" HeaderText="Item" UniqueName="Item" AllowFiltering="false">
</telerik:GridBoundColumn>
<telerik:GridTemplateColumn HeaderStyle-Width="150px" HeaderText="Error Samples" DataField="ErrorSamples" UniqueName="ErrorSamples">
<ItemTemplate>
<telerik:RadButton ID="bAssayErrors" ButtonType="LinkButton" Width="80px" AutoPostBack="true" OnClientClicked="openAssayErrors" CommandName="SelectAssayErrors" runat="server" Text='<%# Eval("ErrorSamples") %>'></telerik:RadButton>
</ItemTemplate>
</telerik:GridTemplateColumn>
</Columns>
</MasterTableView>
</telerik:RadGrid>
<div>
<asp:Label ID="lblmessage" runat="server" Text=""></asp:Label>
</div>
<telerik:RadWindow ID="winAssayErrors" runat="server" Modal="true" VisibleTitlebar="True" VisibleStatusbar="false"
ReloadOnShow="true"
ShowContentDuringLoad="false"
Width="950px" Height="500px"
Title="List by Assay" Style="z-index: 100001;">
<ContentTemplate>
<div>
<table>
<tr>
<td>
<asp:Label ID="lblAssayName" runat="server" Text=""></asp:Label>
</td>
</tr>
<tr>
<td>
<telerik:RadGrid ID="rgAssays" AllowAutomaticUpdates="True"
RenderMode="Lightweight" Skin="Default" runat="server" AllowSorting="True" ShowStatusBar="true" AutoGenerateColumns="False" OnItemDataBound="rgAssays_ItemDataBound" OnItemCommand="rgAssays_ItemCommand"
EnableHeaderContextMenu="True"
Height="220px"
Width="900px"
ViewStateMode="Enabled"
EnableViewState="true">
<ClientSettings>
<Scrolling AllowScroll="true" FrozenColumnsCount="14" SaveScrollPosition="true" UseStaticHeaders="true" />
</ClientSettings>
<MasterTableView HeaderStyle-BackColor="" EnableColumnsViewState="false" AllowAutomaticUpdates="true"
AllowSorting="True" EnableLinqGrouping="False" GroupsDefaultExpanded="False" Width="100%" TableLayout="fixed" ShowFooter="true"
DataKeyNames="AssayName, NoSamples, OKSamples">
<Columns>
<telerik:GridBoundColumn DataField="AssayName" FilterControlAltText="AssayID" HeaderText="AssayName" UniqueName="AssayName" AllowFiltering="false">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="NoSamples" FilterControlAltText="NoSamples" Display="true" HeaderText="# Samples" UniqueName="NoSamples" AllowFiltering="false">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="OKSamples" FilterControlAltText="OKSamples" HeaderText="Ok Samples" UniqueName="OKSamples" ReadOnly="true">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Comments" FilterControlAltText="Comments" HeaderText="Comments" UniqueName="Comments" ReadOnly="true">
</telerik:GridBoundColumn>
<telerik:GridTemplateColumn HeaderStyle-Width="150px" HeaderText="Reprocess" DataField="Reprocess" UniqueName="Reprocess">
<ItemTemplate>
<telerik:RadCheckBox ID="chkReprocess" AutoPostBack="false" Width="80px" runat="server"></telerik:RadCheckBox>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn HeaderStyle-Width="250px" HeaderText="RPNote" DataField="RPNote" UniqueName="RPNote">
<ItemTemplate>
<telerik:RadComboBox runat="server" ID="cbRPNote" Height="300px" Width="100px "
DropDownWidth="500"
ViewStateMode="Enabled"
MarkFirstMatch="true"
HighlightTemplatedItems="True"
EmptyMessage="select"
CheckBoxes="false"
AllowCustomText="false"
Style="z-index: 200001;">
<HeaderTemplate>
<table style="width: 500px; text-align: left">
<tr>
<td style="width: 50px;">ID</td>
<td style="width: 200px;">Spec. Comments</td>
<td style="width: 200px;">User Comments</td>
<td style="width: 80px;"></td>
</tr>
</table>
</HeaderTemplate>
<ItemTemplate>
<table style="width: 550px; text-align: left; float: right;">
<tr>
<td style="width: 50px;">
<asp:Label ID="Rejection_ID" runat="server" Text='<%# Eval("Rejection_ID") %>'></asp:Label>
</td>
<td style="width: 200px;">
<asp:Label ID="Txt_Description" runat="server" Text='<%# Eval("Txt_Description") %>'></asp:Label>
</td>
<td style="width: 200px;">
<asp:TextBox ID="txt_RPNote" runat="server" Text=""></asp:TextBox>
</td>
<td style="width: 80px;">
<telerik:RadButton ID="btnSelectComment" OnClick="btnSelectComment_Click" runat="server" Text="Select"></telerik:RadButton>
</td>
</tr>
</table>
</ItemTemplate>
</telerik:RadComboBox>
</ItemTemplate>
<FooterTemplate>
<asp:Label ID="Label1" runat="server" Text=" Do Server stuff and return.... "></asp:Label>
<telerik:RadButton ID="imRP" runat="server" Text="Reprocess" OnClick="imRP_Click" CommandName="Reprocess"></telerik:RadButton>
<telerik:RadButton ID="btnCloseWinx" runat="server" Text="Close"></telerik:RadButton>
</FooterTemplate>
</telerik:GridTemplateColumn>
</Columns>
</MasterTableView>
</telerik:RadGrid>
</td>
</tr>
</table>
</div>
</ContentTemplate>
</telerik:RadWindow>
</div>
</form>
</body>
</html>
Imports Telerik.Web.UI Public Class Linq Inherits System.Web.UI.Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If Page.IsPostBack = False Then Dim AssysGroup = New List(Of Assays) _ From {New Assays With {.AssayName = "C6", .NoSamples = "12", .OKSamples = "1", .Comments = "OK", .Reprocess = True}, New Assays With {.AssayName = "Crtert", .NoSamples = "5", .OKSamples = "2", .Comments = "OK", .Reprocess = False}, New Assays With {.AssayName = "POWEB", .NoSamples = "2", .OKSamples = "1", .Comments = "OK", .Reprocess = False}, New Assays With {.AssayName = "POWELISA", .NoSamples = "4", .OKSamples = "0", .Comments = "fds", .Reprocess = False}, New Assays With {.AssayName = "CTT", .NoSamples = "3", .OKSamples = "0", .Comments = "", .Reprocess = False}, New Assays With {.AssayName = "POWEA", .NoSamples = "5", .OKSamples = "1", .Comments = "", .Reprocess = False}} rgAssays.DataSource = AssysGroup rgAssays.DataBind() Dim MainGrid = New List(Of sItems) _ From {New sItems With {.Item = "AAA", .ErrorSamples = 10}, New sItems With {.Item = "BBB", .ErrorSamples = 12}, New sItems With {.Item = "CCC", .ErrorSamples = 0}, New sItems With {.Item = "DDD", .ErrorSamples = 0}} RadGrid1.DataSource = MainGrid RadGrid1.DataBind() End If End Sub Private Class Assays Property AssayID As String Property AssayName As String Property NoSamples As String Property OKSamples As String Property Comments As String Property Reprocess As Boolean End Class Private Class sItems Property Item As String Property ErrorSamples As String End Class Protected Sub rgAssays_ItemDataBound(sender As Object, e As Telerik.Web.UI.GridItemEventArgs) If TypeOf e.Item Is GridDataItem Then Dim gridItem As GridDataItem = TryCast(e.Item, GridDataItem) Dim dt As DataTable = New DataTable() Dim combo As RadComboBox combo = gridItem.FindControl("cbRPNote") dt.Columns.Add("Rejection_ID", GetType(Integer)) dt.Columns.Add("Txt_Description", GetType(String)) dt.Columns.Add("txt_RPNote", GetType(String)) dt.Rows.Add(1, "Not enough solution", "") dt.Rows.Add(2, "Positve Result", "") dt.Rows.Add(3, "Damage Specimen", "") dt.Rows.Add(4, "Equipment failute", "") dt.Rows.Add(5, "User mistake", "") combo.DataTextField = "Txt_Description" combo.DataValueField = "Rejection_ID" combo.DataSource = dt combo.DataBind() End If End Sub Protected Sub rgRPNote_SelectedIndexChanged(sender As Object, e As RadComboBoxSelectedIndexChangedEventArgs) Dim val As String = e.Text End Sub Protected Sub btnSelectComment_Click(sender As Object, e As EventArgs) Dim button As RadButton = CType(sender, RadButton) Dim s As String = CType(button.NamingContainer.FindControl("Txt_Description"), Label).Text Dim s1 As String = CType(button.NamingContainer.FindControl("txt_RPNote"), TextBox).Text CType(button.NamingContainer.Parent, RadComboBox).Text = s1 End Sub Protected Sub imRP_Click(sender As Object, e As EventArgs) For Each item As GridDataItem In rgAssays.Items Dim chkRP As RadCheckBox = CType(item.FindControl("chkReprocess"), RadCheckBox) If chkRP.Checked = False Then lblmessage.Text = "Please Enter an RPNote for Items to be reprocess" lblmessage.Focus() Exit Sub End If If CType(item.FindControl("cbRPNote"), RadComboBox).Text.Length > 0 Then Dim s As String = "yea doing long background work" End If Next End Sub End Class