Hi,
I have created several rows and columns etc sing grid and gridviews......I have my columns with headers assigned, however i want the column fixed so that whn the user scrolls the column fixed doesnt move. Similar to that in win forms columns.frozen = true;. And also i want to make all columns non-resizable.
Does anyone have any good references or tips?
Thanks in advance.
Urema.
Loading

Master BillaRank #2,229 · 630 reputationPosted Aug 12, 2009, 8:05 AM EDT
I think you have grid using in listview in WPF. so you can do what ever you have asked
Just i have created to my project.
<ListView Grid.ColumnSpan="3" Margin="2" SnapsToDevicePixels="True"
AlternationCount="2" Grid.Row="1" ItemsSource="{Binding}" Name="lstQCDetails" FontSize="10" Background="WhiteSmoke" >
<ListView.View>
<GridView ColumnHeaderContainerStyle="{DynamicResource GridViewColumnHeaderStyle}" AllowsColumnReorder="False">
<GridViewColumn Width="160" Header="Cust PO Number"
DisplayMemberBinding="{Binding CustPONumber}" />
<GridViewColumn Width="100" Header="Style"
DisplayMemberBinding="{Binding Style}" />
<GridViewColumn Width="130" Header="Month Buy"
DisplayMemberBinding="{Binding MonthBy}" />
<GridViewColumn Width="60" Header="Order Qty"
DisplayMemberBinding="{Binding OrderQty}" />
GridView>
ListView.View>
ListView>
if you have any question about code, please let me know.
Thank you
person91 reputationPosted Aug 12, 2009, 8:14 AM EDT
Sorry im using a grid just and i have used a gridviewheaderrowpresenter to assign columns.
So from the gridViewHeaderRowPresenter with columns assigned to a column collection, how do i make them frozen so that they are read only and wont be affected by the scrollviewer?
Thanks anyway!
Urema.
Roei BarRank #1,271 · 1.4K reputationPosted Aug 12, 2009, 8:28 AM EDT
if you dont have an outer
ScrollViewer, the GridView should pick up that it has limited space, and the internalScrollViewerwill appear.about keeping the Columns Non-Resizable
just add to the GridView the Attribute
CanUserResizeColumns = false
if you liked this dont forget the "Accepted Answer" :-)
Master BillaRank #2,229 · 630 reputationPosted Aug 12, 2009, 8:56 AM EDT
Could you post your code here?
it's may help to me support to quickly
Thank you
person91 reputationPosted Aug 13, 2009, 3:17 AM EDT
Unfortunately i cannot provide any code, this code will be used in industry, so I am unable to do so. I just get stuck here and there.
Basically
////////////canvas and embedded user controls here, data templates etc
//// embeded user controls here, data templates etc
Thanks,
Urema.