This question is locked. New answers and comments are not allowed.
Hi,
Yes, I've seen similar here, but...
This is something that I would think is needed in about 99.99% of about all applications - lookups. We use a RadGridView bound to a DomainDataSource for the "base table" and have another DomainDataSource connected to the "lookup table".
I was told that we needed to dynamically bind the ItemsSource of the GridViewComboBoxColumn in code-behind or we would get that "you need to click it before you see anything" problem. Doing so fixed that problem.
So, here's a little of the XAML (I want to group and sort on the second of the two columns) ...
The code behind to set the CB's is a bit crude for now, but it doesn't fully work yet either:
...oh, sorry... that's the way I wish I could set it (notice the last two lines of the XAML). What I would like to do is specify the "field to sort on" and the "field to group on" from the Combo Box's data source. But, the combo box is written in such a way that it requires that those two fields must come from the base table's data source. The only value in the base table is the code (not good for grouping or sorting).
This is something that needs to get done with almost every data grid in every application. There has to be a simple way to do this that doesn't involve rewriting the application or reinventing the wheel in some way. This is REAL basic stuff. I must be missing something real basic.
Many thanks,
Rob
Yes, I've seen similar here, but...
- We use RIA Services and want to continue doing so (I don't want to convert to MVVM just to get this to work)
- We use VB (I don't want to convert the entire app just to get this to work)
- I don't think the solution of denormalizing all of my databases is a reasonable solution
This is something that I would think is needed in about 99.99% of about all applications - lookups. We use a RadGridView bound to a DomainDataSource for the "base table" and have another DomainDataSource connected to the "lookup table".
I was told that we needed to dynamically bind the ItemsSource of the GridViewComboBoxColumn in code-behind or we would get that "you need to click it before you see anything" problem. Doing so fixed that problem.
So, here's a little of the XAML (I want to group and sort on the second of the two columns) ...
<riaControls:DomainDataSource AutoLoad="False" Height="0" Name="TblSIFObjectPermissionDomainDataSource" QueryName="GetTblSIFObjectPermissionsQuery" Width="0"> <riaControls:DomainDataSource.DomainContext> <my:ZISDomainContext /> </riaControls:DomainDataSource.DomainContext></riaControls:DomainDataSource><telerikGridView:RadGridView Height="250" ItemsSource="{Binding ElementName=TblSIFObjectPermissionDomainDataSource, Path=Data}" Name="TblSIFObjectPermissionRadGridView" AutoGenerateColumns="False" AutoExpandGroups="True"> <telerikGridView:RadGridView.Columns> <telerikGridView:GridViewComboBoxColumn IsFilterable="False" IsGroupable="False" x:Name="comboSIFObject" Width="*" DataMemberBinding="{Binding SIFObjectId}" DisplayMemberPath="SIFObjectName" SelectedValueMemberPath="RecordID" IsReadOnly="True" ShowFieldFilters="False" Header="SIF Object Name" /> <telerikGridView:GridViewComboBoxColumn IsFilterable="True" IsGroupable="True" x:Name="comboSIFWorkgroup" Width="*" DataMemberBinding="{Binding SIFObjectId}" DisplayMemberPath="SIFWorkingGroup" SelectedValueMemberPath="RecordID" IsReadOnly="True" ShowFieldFilters="True" Header="SIF Working Group" GroupMemberPath="SIFWorkingGroup" SortMemberPath="SIFWorkingGroup" />The code behind to set the CB's is a bit crude for now, but it doesn't fully work yet either:
Private Sub TblSIFObjectPermissionRadGridView_DataLoaded(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TblSIFObjectPermissionRadGridView.DataLoaded Dim Context As ZISDomainContext = DSTblSIFObjectsQuery.DomainContext Dim ThisCombo As GridViewComboBoxColumn ThisCombo = TryCast(TblSIFObjectPermissionRadGridView.Columns(0), GridViewComboBoxColumn) ThisCombo.ItemsSource = TryCast(Context.tblSIFObjects, IEnumerable(Of tblSIFObject)) ThisCombo = TryCast(TblSIFObjectPermissionRadGridView.Columns(1), GridViewComboBoxColumn) ThisCombo.ItemsSource = TryCast(Context.tblSIFObjects, IEnumerable(Of tblSIFObject))End Sub...oh, sorry... that's the way I wish I could set it (notice the last two lines of the XAML). What I would like to do is specify the "field to sort on" and the "field to group on" from the Combo Box's data source. But, the combo box is written in such a way that it requires that those two fields must come from the base table's data source. The only value in the base table is the code (not good for grouping or sorting).
This is something that needs to get done with almost every data grid in every application. There has to be a simple way to do this that doesn't involve rewriting the application or reinventing the wheel in some way. This is REAL basic stuff. I must be missing something real basic.
Many thanks,
Rob