Hi!
i have a problem to work with gridViewRow events inside Polling duplex events. i explain :
i have a WCF service (Polling duplew service) that am using this way ;
i have a method GetActionDetailsDataAsync() that calls RecieveGetActionDetailsDataReceived() wich's been executed every 1 second.
i have a RadGridView with a GridViewRowDetail containing another RadGridView here is my code :
for that grid i am using 3 events : RowLoaded,RowUloaded and LoadingRowDetails .
the main grid contains Open Position items and "IF" the row contains closed position the subGrid is displayed by clicking the toggle button in the first column of the main grid ... IF not the toggle button would not appear.
Before Polling Duplex it worked with the 3 events i used , my problem now is that i can't call the events inside the DoWorkRecieved method wich is executed every second ( the contain of the grid can be changed during execution)
Here is what i tried to do so far :
and here is my main page code:
What i tried so far is to put inside the recievRecieved method
RadGridViewActionDetails.RowLoaded += (Grid_RowLoaded);
RadGridViewActionDetails.RowUnloaded += (Grid_RowUnloaded);
but it didn't worked ; during executions if a closed position is added to the grid the toggle button remain hidden...
can you help me please to figure out a solution for this .
Waiting forward for your quick response
KAROUI Haythem
IT Manager at Crea-Digital
i have a problem to work with gridViewRow events inside Polling duplex events. i explain :
i have a WCF service (Polling duplew service) that am using this way ;
i have a method GetActionDetailsDataAsync() that calls RecieveGetActionDetailsDataReceived() wich's been executed every 1 second.
i have a RadGridView with a GridViewRowDetail containing another RadGridView here is my code :
<
telerik:RadGridView
ScrollViewer.HorizontalScrollBarVisibility
=
"Disabled"
Name
=
"RadGridViewActionDetails"
ItemsSource
=
"{Binding Path=MyItemSourceList, Mode=OneWay}"
AutoGenerateColumns
=
"False"
LoadingRowDetails
=
"Grid_LoadingRowDetails"
>
<
telerik:RadGridView.Columns
>
<
telerik:GridViewToggleRowDetailsColumn
/>
<
telerik:GridViewDataColumn
Header
=
"{Binding BindsDirectlyToSource=True}"
Width
=
"*"
DataMemberBinding
=
"{Binding VolumeOpen}"
HeaderTextAlignment
=
"Center"
TextAlignment
=
"Center"
/>
<
telerik:GridViewDataColumn
Header
=
"{Binding BindsDirectlyToSource=True}"
Width
=
"*"
DataMemberBinding
=
"{Binding LotsOpen}"
HeaderTextAlignment
=
"Center"
TextAlignment
=
"Center"
/>
</
telerik:RadGridView.Columns
>
<
telerik:RadGridView.RowDetailsTemplate
>
<
DataTemplate
>
<
telerik:RadExpander
IsExpanded
=
"True"
>
<
telerik:RadGridView
x:Name
=
"RadClosedPosition"
IsFilteringAllowed
=
"False"
Padding
=
"50"
FontSize
=
"12"
AutoGenerateColumns
=
"False"
d:DataContext
=
"{d:DesignInstance model:ClosedDataPositionDTO}"
>
<
telerik:RadGridView.Columns
>
<
telerik:GridViewDataColumn
Header
=
"{Binding BindsDirectlyToSource=True}"
Width
=
"*"
DataMemberBinding
=
"{Binding Volume}"
HeaderTextAlignment
=
"Center"
TextAlignment
=
"Center"
/>
<
telerik:GridViewDataColumn
Header
=
"{Binding BindsDirectlyToSource=True}"
Width
=
"*"
DataMemberBinding
=
"{Binding Lot}"
HeaderTextAlignment
=
"Center"
TextAlignment
=
"Center"
/>
</
telerik:RadGridView.Columns
>
</
telerik:RadGridView
>
</
telerik:RadExpander
>
</
DataTemplate
>
</
telerik:RadGridView.RowDetailsTemplate
>
</
telerik:RadGridView
>
the main grid contains Open Position items and "IF" the row contains closed position the subGrid is displayed by clicking the toggle button in the first column of the main grid ... IF not the toggle button would not appear.
Before Polling Duplex it worked with the 3 events i used , my problem now is that i can't call the events inside the DoWorkRecieved method wich is executed every second ( the contain of the grid can be changed during execution)
Here is what i tried to do so far :
private
void
Grid_LoadingRowDetails(
object
sender, GridViewRowDetailsEventArgs e)
{
if
the open position contains one or many closed positions than
radClosePosition.ItemsSource = item.ListClose;
}
private
void
Grid_RowLoaded(
object
sender, RowLoadedEventArgs e)
{
//if the open position does not contain closed position than the row content is set to null
var gridItem = e.Row.Item
as
ActionDetailsDto;
if
(gridItem !=
null
)
TmpSymbol = gridItem.SymbolOpen;
//Debug.Assert(gridItem != null, "gridItem != null");
if
(gridItem !=
null
&& (e.Row.Item !=
null
&& gridItem.ListClose.Count == 0))
{
var row = e.Row.ChildrenOfType<GridViewCell>().First();
row.Content =
null
;
}
}
private
void
Grid_RowUnloaded(
object
sender, RowUnloadedEventArgs e)
{
//if the open position does not contain closed position than the togglebutton is hidden
if
(e.Row.Item !=
null
)
{
var rowitem = e.Row.ChildrenOfType<GridViewCell>().First();
rowitem.Visibility = Visibility.Visible;
}
}
public
MainPage()
{
InitializeComponent();
/*..............................*/
_proxy.GetActionDetailsDataAsync("t.kheribi", "testAccount");
_proxy.RecieveGetActionDetailsDataReceived += _proxy_RecieveGetActionDetailsDataReceived;
}
void
_proxy_RecieveGetActionDetailsDataReceived(
object
sender, FeedService.RecieveGetActionDetailsDataReceivedEventArgs e)
{
var serviceResultList = ParsingServiceTools.ParsingActionDetails(e.request.Arg);
var deletedItemsList =
new
ObservableCollection<ActionDetailsDto>();
//this method is being executed each second and it would be perfect if i could handle here the GridViewEvents
}
RadGridViewActionDetails.RowLoaded += (Grid_RowLoaded);
RadGridViewActionDetails.RowUnloaded += (Grid_RowUnloaded);
but it didn't worked ; during executions if a closed position is added to the grid the toggle button remain hidden...
can you help me please to figure out a solution for this .
Waiting forward for your quick response
KAROUI Haythem
IT Manager at Crea-Digital