错误在网格视图中显示 [英] err in grid view to display
本文介绍了错误在网格视图中显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
public int getStatusCount(string status)
{
int count = 0;
foreach (GridDataItem item in RadGrid1.MasterTableView.Items)
{
string id = item[status].Text; //get the pid here
if (id == "s")
{
count = count + 1;
}
}
return count;
}
int test = RadGrid1.MasterTableView.Items.Count;
public double getpercent(int submitted,int total)
{
double percent = Math.Round((double)(submitted * 100) / total, 1);
return percent;
}
推荐答案
< radG:RadGrid ID =RadGrid2runat =serverAllowSorting =TrueAutoGenerateColumns =false>
< MasterTableView>
< Columns>
< radG:GridTemplateColumn UniqueName =TemplateColumn>
< HeaderTemplate>
< table id =Table1cellspacing =1cellpadding =1width =300border =1>
< tr>
< td align =center>
< b>地址< / b>
< / td>
< / tr>
< tr>
< td>
< b> City< / b>
< / td>
< / tr>
< / table>
< / HeaderTemplate>
< ItemTemplate>
< table id =Table2cellspacing =1cellpadding =1width =300border =1>
< tr>
< td>
< asp:Label ID = Label2runat =serverText ='<%#getStatusCount(s)%>'>< / asp:Label>
< / td>
< td>
< asp:Label ID =Label1runat =serverText ='<%#getpercent(getStatusCount(s),RadGrid1。 MasterTableView.Items.Count)%& gt;'>< / asp:标签>
< / td>
< / tr>
< / table> ;
< / ItemTemplate>
< / radG:GridTemplateColumn>
< / Columns>
< / MasterTableView>
< / radG:RadGrid>
<radG:RadGrid ID="RadGrid2" runat="server" AllowSorting="True" AutoGenerateColumns="false">
<MasterTableView>
<Columns>
<radG:GridTemplateColumn UniqueName="TemplateColumn">
<HeaderTemplate>
<table id="Table1" cellspacing="1" cellpadding="1" width="300" border="1">
<tr>
<td align="center">
<b>Address</b>
</td>
</tr>
<tr>
<td>
<b>City</b>
</td>
</tr>
</table>
</HeaderTemplate>
<ItemTemplate>
<table id="Table2" cellspacing="1" cellpadding="1" width="300" border="1">
<tr>
<td>
<asp:Label ID="Label2" runat="server" Text='<%# getStatusCount("s") %>'></asp:Label>
</td>
<td>
<asp:Label ID="Label1" runat="server" Text='<%# getpercent(getStatusCount("s"),RadGrid1.MasterTableView.Items.Count) %>'></asp:Label>
</td>
</tr>
</table>
</ItemTemplate>
</radG:GridTemplateColumn>
</Columns>
</MasterTableView>
</radG:RadGrid>
Difference between AllowUnsafeUpdates and RunWithElevated previledges.
What is content type.
What is content type hub/ can content types be managed through central admin site.
Powershell command to install solution.
What is sandbox solution? Can a visual webpart be deployed as sandbox solution.
Difference between LINQ and CAML.
这篇关于错误在网格视图中显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文