The column data get merged with other column data if we hide the column dynamically. i have taken a gridview and the columns are defined in the xaml. we have option to show and hide the columns dynamically. when we hide columns dynamically the data of hidden column get merge with the next visible column. If i reload the page containing that grid it shows properly. Images attached.
Please review this and provide a solution, we have a customer delivery pending for this.
if you ask for sample code i can't , but i can do GoToMeeting session.
here is he code snippet which we used to hide the column :
Here is the XAML code snippet:
Please review this and provide a solution, we have a customer delivery pending for this.
if you ask for sample code i can't , but i can do GoToMeeting session.
here is he code snippet which we used to hide the column :
indVis = 0;
foreach
(var itemcur
in
ListItemsCurrent)
{
foreach
(var item
in
dg.Columns)
{
if
(itemcur.Id == item.UniqueName)
{
item.IsVisible =
true
;
item.DisplayIndex = indVis;
item.AggregateFunctions.Clear();
if
(indVis == 0)
{
CountFunction f =
new
CountFunction();
f.Caption =
"Total Items: "
;
item.AggregateFunctions.Add(f);
}
break
;
}
}
indVis++;
}
<
my:CustomDataGrid
x:Name
=
"grdList"
CanUserFreezeColumns
=
"False"
ShowGroupPanel
=
"False"
ShowColumnFooters
=
"True"
Tag
=
"Program Activities"
AutoGenerateColumns
=
"False"
Margin
=
"0,32,0,29"
IsReadOnly
=
"True"
KeyDown
=
"grdList_KeyDown"
RowActivated
=
"grdList_RowActivated"
KeyUp
=
"grdList_KeyUp"
MouseRightButtonUp
=
"grdList_MouseRightButtonUp"
MouseRightButtonDown
=
"grdList_MouseRightButtonDown"
SelectionChanged
=
"grdList_SelectionChanged"
ItemsSource
=
"{Binding Path=Data, ElementName=DomainDataSourceActivity}"
SelectionMode
=
"Single"
>
<
telerikGridView:RadGridView.Columns
>
<
telerikGridView:GridViewDataColumn
Header
=
"Completed"
DataMemberBinding
=
"{Binding complete}"
IsReadOnly
=
"True"
/>
<
telerikGridView:GridViewDataColumn
Header
=
"Activity"
DataMemberBinding
=
"{Binding action_type}"
IsReadOnly
=
"True"
>
<!--<
telerikGridView:GridViewDataColumn.AggregateFunctions
>
<
telerikData:CountFunction
Caption
=
"Total Items: "
/>
</
telerikGridView:GridViewDataColumn.AggregateFunctions
>-->
</
telerikGridView:GridViewDataColumn
>
<
telerikGridView:GridViewDataColumn
Header
=
"Facility Name"
DataMemberBinding
=
"{Binding facility_name}"
IsReadOnly
=
"True"
/>
<
telerikGridView:GridViewDataColumn
Header
=
"Date Due"
DataMemberBinding
=
"{Binding Due_Date, Converter={StaticResource DateConverter}}"
IsReadOnly
=
"True"
/>
<
telerikGridView:GridViewDataColumn
Header
=
"Date Completed"
DataMemberBinding
=
"{Binding date_completed, Converter={StaticResource DateConverter}}"
/>
<
telerikGridView:GridViewDataColumn
Header
=
"Staff Name"
DataMemberBinding
=
"{Binding compltedBy}"
/>
<
telerikGridView:GridViewDataColumn
Header
=
"Contact"
DataMemberBinding
=
"{Binding full_name}"
IsVisible
=
"False"
/>
<
telerikGridView:GridViewDataColumn
Header
=
"County"
DataMemberBinding
=
"{Binding county}"
IsVisible
=
"False"
/>
<
telerikGridView:GridViewDataColumn
Header
=
"District"
DataMemberBinding
=
"{Binding district_id}"
IsVisible
=
"False"
/>
<
telerikGridView:GridViewDataColumn
Header
=
"State/Local"
DataMemberBinding
=
"{Binding locale}"
IsVisible
=
"False"
/>
<
telerikGridView:GridViewDataColumn
Header
=
"Topic Code"
DataMemberBinding
=
"{Binding topic_Item}"
IsVisible
=
"False"
/>
<
telerikGridView:GridViewDataColumn
Header
=
"Topic Description"
DataMemberBinding
=
"{Binding topic_desc }"
IsVisible
=
"False"
/>
<
telerikGridView:GridViewDataColumn
Header
=
"Topic Comments"
DataMemberBinding
=
"{Binding topic_comment}"
IsVisible
=
"False"
TextTrimming
=
"WordEllipsis"
/>
<
telerikGridView:GridViewDataColumn
Header
=
"Activity Comment"
DataMemberBinding
=
"{Binding concerns}"
TextTrimming
=
"WordEllipsis"
IsVisible
=
"False"
/>
<
telerikGridView:GridViewDataColumn
Header
=
"Instances"
DataMemberBinding
=
"{Binding Instances}"
IsVisible
=
"False"
/>
<
telerikGridView:GridViewDataColumn
Header
=
"Time Spent(Minutes)"
DataMemberBinding
=
"{Binding time_spent}"
IsVisible
=
"False"
/>
<
telerikGridView:GridViewDataColumn
Header
=
"Travel Spent(Minutes)"
DataMemberBinding
=
"{Binding travel_time}"
IsVisible
=
"False"
/>
<
telerikGridView:GridViewDataColumn
Header
=
"Contact Phone"
DataMemberBinding
=
"{Binding ContactPhone, Converter={StaticResource PhoneConverter}}"
IsVisible
=
"False"
/>
<
telerikGridView:GridViewDataColumn
Header
=
"Staff Work Phone"
DataMemberBinding
=
"{Binding StaffWorkPhone, Converter={StaticResource PhoneConverter}}"
IsVisible
=
"False"
/>
<
telerikGridView:GridViewDataColumn
Header
=
"Staff Home Phone"
DataMemberBinding
=
"{Binding StaffHomePhone, Converter={StaticResource PhoneConverter}}"
IsVisible
=
"False"
/>
<
telerikGridView:GridViewDataColumn
Header
=
"# of Attachments"
DataMemberBinding
=
"{Binding NoOfAttachments}"
IsVisible
=
"False"
/>
<
telerikGridView:GridViewDataColumn
Header
=
"# of Cases Associated"
DataMemberBinding
=
"{Binding NoOfCasesAssociated}"
IsVisible
=
"False"
/>
<
telerikGridView:GridViewDataColumn
Header
=
"Training Topic"
DataMemberBinding
=
"{Binding TrainingTopic}"
IsVisible
=
"False"
/>
<
telerikGridView:GridViewDataColumn
Header
=
"Number of Participants"
DataMemberBinding
=
"{Binding NoOfParticipants}"
IsVisible
=
"False"
/>
<
telerikGridView:GridViewDataColumn
Header
=
"Number of Trainees"
DataMemberBinding
=
"{Binding NoOfTrainees}"
IsVisible
=
"False"
/>
<
telerikGridView:GridViewDataColumn
Header
=
"# of Associated activities"
DataMemberBinding
=
"{Binding NoOfAssociatedActivities}"
IsVisible
=
"False"
/>
<
telerikGridView:GridViewDataColumn
Header
=
"Activity ID"
DataMemberBinding
=
"{Binding ActivityID}"
/>
</
telerikGridView:RadGridView.Columns
>
</
my:CustomDataGrid
>