Click here to Skip to main content
15,895,142 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi I Placed one datagrid in one tab control


C#
<tabitem header="Storage Details" fontsize="20">
                <grid removed="#FFE5E5E5" margin="0,1,0,-1">
                    <grid.columndefinitions>
                        <columndefinition />
                    </grid.columndefinitions>
                    
                    <datagrid>
                        Style="{StaticResource DataGrid}" 
                        IsReadOnly="True"
                        Margin="71,230,170,107"
                        ScrollViewer.CanContentScroll="True"
                        ScrollViewer.VerticalScrollBarVisibility="Auto"
                        SelectionChanged="grdStorageDetails_SelectionChanged"
                        Name="grdStorageDetails"></datagrid>                   


                </grid>
            </tabitem>

The following code is not working when the tab Item is hidden when its open its workig fine

C#
grdStorageDetails.Columns[8].Visibility = System.Windows.Visibility.Visible;
                grdStorageDetails.Columns[8].Header = "Name";
                grdStorageDetails.Columns[8].Width = 150;


                grdStorageDetails.Columns[6].Visibility = System.Windows.Visibility.Visible;
                grdStorageDetails.Columns[6].Header = "Description";

Please help me to resolve the problem
Posted
Updated 8-Aug-14 0:51am
v3
Comments
Vincent Beek 8-Aug-14 7:25am    
Hide the TAB after 'the following code'

1 solution

XML
<asp:GridView ID="GVdata" runat="server" AllowPaging="True"  AllowSorting="True" AutoGenerateColumns="False" >
     <Columns>
    <asp:TemplateField SortExpression="Subnet" HeaderText="Subnet">
        <HeaderTemplate>
                <asp:Label ID="SubnetHeader" ToolTip="My Tip to you" runat="server" Text="Label"></asp:Label>
        </HeaderTemplate>
        <ItemTemplate >
                <asp:Label ID="lblSubnet" runat="server" Text='<%# Bind("ID") %>' ></asp:Label>
        </ItemTemplate>
    </asp:TemplateField>
     <Columns>
</asp:GridView >


or

GridView1.Columns(index).HeaderText = "My Header Text"
 
Share this answer
 
v2
Comments
[no name] 7-Aug-14 5:48am    
If you are using in WPF, then include that too in your question, so that a helper don't get confused. Question should be accurate as much as possible.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900