Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vb.net/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net &引用;分类“;Gridview中的模板字段_Asp.net_Vb.net_Sorting_Gridview - Fatal编程技术网

Asp.net &引用;分类“;Gridview中的模板字段

Asp.net &引用;分类“;Gridview中的模板字段,asp.net,vb.net,sorting,gridview,Asp.net,Vb.net,Sorting,Gridview,基本上,我在对代码进行排序时遇到了一个问题,即图标按顺序排序,这与“sortexpression”或“Enable sorting”不同,因为它们对我不起作用,因为它会出现“Error:Invalid Column Name”,因为我实际上没有使用SQLDatabase中的任何内容 所以我问你,社区是否有其他方式可以让我在VB或ASP中对这个字段进行排序,这样当我单击列名(可能应该是headertext?“State”)时,它会对它进行排序,以便所有图标按顺序分组。下面是给我带来问题的代码片段

基本上,我在对代码进行排序时遇到了一个问题,即图标按顺序排序,这与“sortexpression”或“Enable sorting”不同,因为它们对我不起作用,因为它会出现“Error:Invalid Column Name”,因为我实际上没有使用SQLDatabase中的任何内容

所以我问你,社区是否有其他方式可以让我在VB或ASP中对这个字段进行排序,这样当我单击列名(可能应该是headertext?“State”)时,它会对它进行排序,以便所有图标按顺序分组。下面是给我带来问题的代码片段

<asp:TemplateField HeaderText="State" ItemStyle-Width="80px">
    <ItemTemplate>
        <asp:Image ID="imgFlag" runat="server" Height="20px" Width="20px" ImageAlign="Middle" ImageUrl="~\icons\actn006.gif" Visible="False" />
        <asp:Image ID="imgFlag2" runat="server" Height="20px" Width="20px" ImageAlign="Middle" ImageUrl="~\icons\actn005.gif" Visible="False" />
        <asp:Image ID="imgFlag21" runat="server" Height="20px" ImageUrl="~/icons/Gtm.gif" Visible="False" Width="20px" />
        <asp:Image ID="imgFlag22" runat="server" Height="20px" ImageUrl="~/icons/Otm.gif" Visible="False" Width="20px" />
        <asp:Image ID="imgFlag23" runat="server" Height="20px" ImageUrl="~/icons/Rtm.gif" Visible="False" Width="20px" />
        <asp:Image ID="imgFlag3" runat="server" Height="20px" Width="20px" ImageAlign="Middle" ImageUrl="~\icons\actn000.gif" Visible="False" />
    </ItemTemplate>
    <ItemStyle Width="80px"></ItemStyle>
</asp:TemplateField>


提前感谢您的建议,请把它们弄清楚,因为我的编码解释并不精彩,因为我还在学习

如何填充GridView?你能发布代码吗?填充GridView?你是说通过SQLDatasource?我刚才解释过gridview是一个SQLdatasource,但这个字段不是,它只是保存图标。图标是如何填充到网格中的?