This is a migrated thread and some comments may be shown as answers.

[Solved] Rad Grid View with RIA services and Combo box

13 Answers 237 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Rakesh
Top achievements
Rank 1
Rakesh asked on 02 Sep 2010, 03:47 PM
Hello Telerik Team,
        I am trying to develop this feature in my grid view.

1. It uses SL 4 VS 2010 - WCF Ria services
2. It pulls data from a table and one of the fields is a foreign key of another look up table.

3. When I browsed through samples, I found out that we can write codeless RIA services. So all I want is to have a combobox with the lookup table values. The user should be able to select the combobox values inside the grid.

Can you please direct me how to achieve a combo box with ria service inside a grid and
FYI: since it has foreign key relationship, the corresponding fact table data has to be updated accordingly.

Thanks,
Rakesh

13 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 07 Sep 2010, 01:49 PM
Hello Rakesh,

In order to achieve a code-less setting of the ItemsSource of the GridViewComboBoxColumn, you need to set it inside the Resource section and then use it as a StaticResource in the definition of the column. 
For example:

<UserControl.Resources>
   <riaControls:DomainDataSource x:Key="customers"  
                 Name="customerDomainDataSource" 
                 QueryName="GetOrdersQuery" AutoLoad="True" >
     <riaControls:DomainDataSource.DomainContext>
          <local:CustomersDomainContext />
     </riaControls:DomainDataSource.DomainContext>
  </riaControls:DomainDataSource>
</UserControl.Resources>

<telerik:GridViewComboBoxColumn Header="ComboxColumn"
               DataMemberBinding="{Binding CustomerID}"                                                                                                  SelectedValueMemberPath="{Binding CustomerID}"                                       
              DisplayMemberPath="{Binding CompanyName}"                                                    
               ItemsSource="{Binding Data, Source={StaticResource customers}}" />

I hope that helps. However, if you need any further assistance or a sample project for a reference, do not hesitate to get back to us.

Greetings,
Maya
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Rakesh
Top achievements
Rank 1
answered on 07 Sep 2010, 07:44 PM
Maya,

Thank you so much for the reply.

Now Combo box works great;
My combo box is inside the grid ;

How do I load the grid after the combo box loading of domain data source is done?

in code-behind; I had the workaround like
   making the second datasource autoload as false
and after the data loaded event of first domain data source I explicitly write in code-behind to load second domain data source.

Is there a proper way of doing it instead of work-around?

Thanks for all the help,
Great work guys
Rakesh
0
Maya
Telerik team
answered on 08 Sep 2010, 08:22 AM
Hello Rakesh,

Actually, the way is handle the asynchronous loading of the data is the recommended approach - set the AutoLoad Property to "False", load the data for the ComboBox in the code-behind and once it is done, set the ItemsSource Property of the grid. Furthermore, you can use the IsBusy Property of the grid, while loading and you can even implement a RadBusyIndicator.
 

Sincerely yours,
Maya
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Rakesh
Top achievements
Rank 1
answered on 08 Sep 2010, 03:12 PM
Hi Maya,
Thanks again.

Now I am trying to use the column footer or group footer ;
Group footer I mean its not going to be grouped by any parameter. It's going to be a whole grid footer,
Inside that I want to have  a stackpanel template of

Aggregate count function in left
and rad data pager in right alignment.

How do I place these two controls inside the group footer?

I am using column footers now as shown in the picture but I dont want those line seperations and stuff.

Please direct me how I have to go.

Thanks
0
Maya
Telerik team
answered on 09 Sep 2010, 03:59 PM
Hello Rakesh,

I am sending you a sample project illustrating how to get the result of an aggregate function of a column and put it inside a TextBox next to the RadDataPager.
Please take a look at it and let me know if it meets your requirements.
  

Best wishes,
Maya
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Rakesh
Top achievements
Rank 1
answered on 09 Sep 2010, 04:28 PM
Maya,

I am sorry you got it wrong;

I need to have column count and rad data pager together inside the footer of my gridview.

To be precise I need my aggregation function and rad data pager in a stack panel and that stackpanel has to be placed inside the footer of my gridview.

If I use column footer, it will let me place the content in the same coulmn,.

If i want to use group footer, I have nothing to group.

So as we do like Grid.Rowspan = 3 , is it possible to do something like that in the footer of my gridview so that the panel extends over the 3 columns of my gridview?

Thanks for your help
Rakesh
0
Vlad
Telerik team
answered on 09 Sep 2010, 04:37 PM
Hello,

 If you want pager to be inside the grid you should modify RadGridView template using Blend and insert the pager at desired position. Otherwise you can just wrap the grid and the pager in a separate UserControl and reuse this control instead. 

Greetings,
Vlad
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Rakesh
Top achievements
Rank 1
answered on 09 Sep 2010, 04:39 PM
Thanks for the reply,

Can you please show me a sample of how to place data pager inside the gridview?

Thanks
0
Vlad
Telerik team
answered on 10 Sep 2010, 07:09 AM
Hello,

 As I said you can modify the grid template using Blend and insert the pager at desired place.

Kind regards,
Vlad
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Rakesh
Top achievements
Rank 1
answered on 16 Sep 2010, 10:05 PM
Hello Telerik team,

I am trying to use the data validation in grid in cell validating event as displayed in this link

http://www.telerik.com/help/silverlight/gridview-managing-data-validation.html


Validation is ok. i.e. it shows a red cell but it doesnt pop-up the error message automatically. if you hover your mouse to the top-right corner, it displays the appropriate message,.

My question is as soon as a data is invalid, along with not only displaying the red box but also how to show the error message without needing the user to hover the mouse to the top-right corner?

Thanks
Rakesh
================================
Code Snippet

 

 

void dg_gridview_CellValidating(object sender, GridViewCellValidatingEventArgs e)

 

{

 

 

 

 

 

if (e.Cell.Column.UniqueName != "GroupName")

 

{

 

 

string _old_value = (string)e.OldValue;

 

 

 

string _new_value = (string)e.NewValue;

 

 

 

if (!String.IsNullOrEmpty(_new_value) && (_old_value != _new_value))

 

{

 

 

if (e.Cell.Column.UniqueName == "Code")

 

{

 

 

gActivityCode _editing_code = _domS_dms.gActivityCodes.Where(w => w.activityCode == _new_value.ToUpper()).FirstOrDefault();

 

 

 

if (_editing_code != null)

 

{

e.IsValid =

 

false;

 

e.ErrorMessage =

 

"Code already exists";

 

}

}

 

 

else

 

{

 

 

gActivityCode _editing_code = _domS_dms.gActivityCodes.Where(w => w.descrip == _new_value).FirstOrDefault();

 

 

 

if (_editing_code != null)

 

{

e.IsValid =

 

false;

 

e.ErrorMessage =

 

"Description already exists";

 

}

}

}

}

}

0
Maya
Telerik team
answered on 21 Sep 2010, 03:47 PM
Hello Rakesh,

You may take a look at this forum thread, where you will find explanation as well as a sample project illustrating how to achieve the functionality you want.

Regards,
Maya
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Aakansha
Top achievements
Rank 1
answered on 18 Feb 2011, 07:34 AM
Hello,

I have one querry,I am working with RadDatapager..
I want to integrate raddatapager with rad grid,Datapager to put in Radgrid header i am not aware how this will be working..

Any sugession how can i include raddatapager inside radgrid ,i want paging to be visible on radgrid header as well as on radgrid footer.


Thanks,
0
Maya
Telerik team
answered on 18 Feb 2011, 05:34 PM
Hello Cindrella,

You may take a look at our online documentation for a reference how to implement the RadDataPager with the RadGridView. If you want to define it in any particular place inside the grid, you will need to predefine a bunch of templates, which is not an easy task and may lead to undesired and unexpected behavior. So, i would recommend you to either define it above or below the grid.
 

Best wishes,
Maya
the Telerik team
Tags
GridView
Asked by
Rakesh
Top achievements
Rank 1
Answers by
Maya
Telerik team
Rakesh
Top achievements
Rank 1
Vlad
Telerik team
Aakansha
Top achievements
Rank 1
Share this question
or