这是我的网格,当我删除模板按钮时,网格运行良好,但是当包含模板按钮时,网格加载不好并且ui有点被破坏,所有数据都出现在框内的链接字符串中当模板按钮到位时:
<telerik:RadGrid OnItemCreated="gvClients_ItemCreated" runat="server" ID="gvClients" ClientSettings-EnablePostBackOnRowClick="true" CellSpacing="0" GridLines="None" Skin="Glow" DataSourceID="SqlDataSource1" AllowPaging="True" AllowSorting="True" OnSelectedIndexChanged="gvClients_SelectedIndexChanged" OnDataBound="gvClients_DataBound" AutoGenerateColumns="False">
<ClientSettings>
<Selecting AllowRowSelect="True" />
</ClientSettings>
<MasterTableView DataKeyNames="id" DataSourceID="SqlDataSource1" HierarchyLoadMode="Client">
<Columns>
<telerik:GridBoundColumn DataField="seniorId" DataType="System.Int32" FilterControlAltText="Filter seniorId column" HeaderText="seniorId" SortExpression="seniorId" UniqueName="seniorId" Visible="False">
<ColumnValidationSettings>
<ModelErrorMessage Text="" />
</ColumnValidationSettings>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="id" DataType="System.Int32" FilterControlAltText="Filter id column" HeaderText="תעדות זהות" ReadOnly="True" SortExpression="id" UniqueName="id">
<ColumnValidationSettings>
<ModelErrorMessage Text="" />
</ColumnValidationSettings>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="password" FilterControlAltText="Filter password column" HeaderText="סיסמא" SortExpression="password" UniqueName="password">
<ColumnValidationSettings>
<ModelErrorMessage Text="" />
</ColumnValidationSettings>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="fName" FilterControlAltText="Filter fName column" HeaderText="שם פרטי" SortExpression="fName" UniqueName="fName">
<ColumnValidationSettings>
<ModelErrorMessage Text="" />
</ColumnValidationSettings>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="lName" FilterControlAltText="Filter lName column" HeaderText="שם משפחה" SortExpression="lName" UniqueName="lName">
<ColumnValidationSettings>
<ModelErrorMessage Text="" />
</ColumnValidationSettings>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="mPhone" FilterControlAltText="Filter mPhone column" HeaderText="מספר טלפון" SortExpression="mPhone" UniqueName="mPhone">
<ColumnValidationSettings>
<ModelErrorMessage Text="" />
</ColumnValidationSettings>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="address" FilterControlAltText="Filter address column" HeaderText="כתובת" SortExpression="address" UniqueName="address">
<ColumnValidationSettings>
<ModelErrorMessage Text="" />
</ColumnValidationSettings>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="sc" DataType="System.Byte" FilterControlAltText="Filter sc column" HeaderText="sc" SortExpression="sc" UniqueName="sc" Visible="False">
<ColumnValidationSettings>
<ModelErrorMessage Text="" />
</ColumnValidationSettings>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="email" FilterControlAltText="Filter email column" HeaderText="אימייל" SortExpression="email" UniqueName="email">
<ColumnValidationSettings>
<ModelErrorMessage Text="" />
</ColumnValidationSettings>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="dateJoined" DataFormatString="{0:HH:mm dd-MM-yyyy}" DataType="System.DateTime" FilterControlAltText="Filter dateJoined column" HeaderText="תאריך הצטרפות" SortExpression="dateJoined" UniqueName="dateJoined">
<ColumnValidationSettings>
<ModelErrorMessage Text="" />
</ColumnValidationSettings>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="contract" FilterControlAltText="Filter contract column" HeaderText="קובץ חוזה" SortExpression="contract" UniqueName="contract">
<ColumnValidationSettings>
<ModelErrorMessage Text="" />
</ColumnValidationSettings>
</telerik:GridBoundColumn>
<telerik:GridTemplateColumn FilterControlAltText="Filter TemplateColumn column" HeaderText="הורד קובץ" UniqueName="downloadbutton">
<ItemTemplate>
<telerik:RadButton ID="btnDownload" runat="server" Skin="Glow" Text="הורד קובץ" CommandArgument="<%#Container.ItemIndex %>" OnCommand="btnDownload_Command">
</telerik:RadButton>
</ItemTemplate>
</telerik:GridTemplateColumn>
</Columns>
<PagerStyle AlwaysVisible="True" />
</MasterTableView>
答案 0 :(得分:1)
我不知道问题是什么,但在创建新解决方案并将相同的源文件复制到新解决方案后,问题似乎已经解决了。
非常感谢!
答案 1 :(得分:-1)
我添加了templatecolumn,如下所示(没有btnDownload_Command),并且它正确呈现。它可能是Text propery中使用的特殊字符吗?
<telerik:GridTemplateColumn FilterControlAltText="Filter TemplateColumn column" HeaderText="t" UniqueName="downloadbutton">
<ItemTemplate>
<telerik:RadButton ID="btnDownload" runat="server" Text="HeaderName" CommandArgument="<%#Container.ItemIndex %>" >
</telerik:RadButton>
</ItemTemplate>
</telerik:GridTemplateColumn>