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

[Solved] ComboBoxEditor - no edit mode

9 Answers 224 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.
Jack
Top achievements
Rank 1
Jack asked on 14 Jun 2009, 06:41 PM
Is there a way to make the comboBoxEditor be editable?  I would have thought it had all the same options as the RadComboBox.

I want to have a drop down with a list of 1-4 but if the user types a 5 then that should be okay.

thanks

jack

9 Answers, 1 is accepted

Sort by
0
Pavel Pavlov
Telerik team
answered on 18 Jun 2009, 01:53 PM
Hi Jack,

To have more customization options and to  avoid the limits of automatically generated ComboBox column I would recommend the following approach :

Use GridViewDataColumn instead of GridViewComboBoxColumn. Set the CellTemplate Property to a custom template containing a ComboBox. Within the template you may set whatever property of the ComboBox as well as bind to specific ComboBox events in order to accomplish custom specific logic.

Kind regards,
Pavel Pavlov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
satish
Top achievements
Rank 1
answered on 13 Jul 2009, 10:06 AM
Hi Pavel,

   I am also having the same problem. If possible could you please send me some sample on this. Below is the code which i have written in my mehod. Please help me ASAP.

   Dim StatusList As New List(Of String)  
      StatusList.Add("Projected")  
      StatusList.Add("Scheduled")  
      StatusList.Add("Completed")  
      StatusList.Add("Approved")  
      StatusList.Add("Skip Approved")  
      StatusList.Add("Skip Denied")  
 
 
      'Dim oComboBox As New Telerik.Windows.Controls.RadComboBox()  
      'oComboBox.ItemsSource = StatusList  
      'oComboBox.IsEditable = True  
 
 
 
      Dim comboBoxEditorSettings As New Telerik.Windows.Controls.ComboBoxEditorSettings()  
      comboBoxEditorSettings.ItemsSource = StatusList  
 
      DirectCast(Me.grdProducts.Columns(5), GridViewDataColumn).EditorSettings = comboBoxEditorSettings 

Regards
Satish
0
Pavel Pavlov
Telerik team
answered on 14 Jul 2009, 01:43 PM
Hi,

Please see the sample app. attached.
It demonstrates a way to customize the automatically generated ComboBox utilizing the CellEditStyle property of the editor settings.

Best wishes,
Pavel Pavlov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
satish
Top achievements
Rank 1
answered on 15 Jul 2009, 10:24 AM
Hi Pavel,

  Thanks a lot for your help. It's gr8.
 
  I am requetsing you for your help. I am binding the RadTimePicker to the RadGridView and populating the data. 
  My problem is. I am able to select the Time from the control. Suppose if I moved out from that cell, the time is changing to previous time. it's now showing my selected time. Could you please help me on this.

Here I have attached my code. Please have a look in to this.

<telerik:GridViewDataColumn HeaderText="StartTime" DataFormatString="{}{0:t}" DataMemberBinding="{Binding BeginDateTime}" IsResizable="False">  
  <telerik:GridViewDataColumn.CellTemplate> 
    <DataTemplate> 
        <TextBlock Text="{Binding BeginDateTime, Converter={StaticResource FormatConverter}, ConverterParameter=\{0:t\}}"  /> 
    </DataTemplate> 
  </telerik:GridViewDataColumn.CellTemplate> 
  <telerik:GridViewDataColumn.CellEditTemplate> 
    <DataTemplate> 
        <telerikInput:RadTimePicker SelectedTime="{Binding BeginDateTime}" /> 
    </DataTemplate> 
  </telerik:GridViewDataColumn.CellEditTemplate> 
</telerik:GridViewDataColumn> 

Once again thanks for your help.

Thanks & Kind Regards
Satish
0
Vlad
Telerik team
answered on 15 Jul 2009, 01:39 PM
Hello satish,

You need to add Mode = TwoWay for this Binding - in Silverlight by default this is OneWay. Your business object also should implement INotifyPropertyChanged.

Greetings,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
satish
Top achievements
Rank 1
answered on 16 Jul 2009, 11:16 AM
Hi Vlad,

 Thanks for the response. I did the same thing eventhough it's not showing the selected time in the grid. Could you please look the following code.

<telerik:GridViewDataColumn HeaderText="StartTime" DataFormatString="{}{0:t}" DataMemberBinding="{Binding BeginDateTime, Mode=TwoWay}" IsResizable="False">  
      <telerik:GridViewDataColumn.CellTemplate> 
       <DataTemplate> 
           <TextBlock Text="{Binding BeginDateTime, Mode=TwoWay, Converter={StaticResource FormatConverter}, ConverterParameter=\{0:t\}}"  /> 
       </DataTemplate> 
      </telerik:GridViewDataColumn.CellTemplate> 
      <telerik:GridViewDataColumn.CellEditTemplate> 
          <DataTemplate> 
              <telerikInput:RadTimePicker SelectedTime="{Binding BeginDateTime, Mode=TwoWay}" /> 
          </DataTemplate> 
      </telerik:GridViewDataColumn.CellEditTemplate> 
</telerik:GridViewDataColumn> 

Please help me.

Thanks & Regards
Satish
0
Rossen Hristov
Telerik team
answered on 22 Jul 2009, 07:11 AM
Hi satish,

If your only goal is to display the DateTime value as a time, you do not need to redefine the CellTemplate at all. The DataFormatString should be enough to tell the column to display its values formatted as time.

<UserControl x:Class="TicketID_219655_TimeFormatColumn.MainPage" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"  
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"  
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"  
    xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView" 
    mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480"
    <Grid> 
        <telerik:RadGridView Name="clubsGrid" Grid.Row="0" AutoGenerateColumns="False" 
                ColumnsWidthMode="Auto"
            <telerik:RadGridView.Columns> 
                <telerik:GridViewDataColumn Header="Name" DataMemberBinding="{Binding Name}"
                </telerik:GridViewDataColumn> 
                <telerik:GridViewDataColumn Header="Est." DataMemberBinding="{Binding Established}" 
                        DataFormatString="{}{0:t}"
                </telerik:GridViewDataColumn> 
            </telerik:RadGridView.Columns> 
        </telerik:RadGridView> 
    </Grid> 
</UserControl> 
 

I have attached the sample project that the above code snippet is from.

Please, take a look at it and let me know if you have any other questions or if this is not what you are trying to achieve. If this is the case, can you please attach your original project.

Kind regards,
Ross
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
satish
Top achievements
Rank 1
answered on 23 Jul 2009, 11:46 AM
Hi Ross,

  Thanks for the response. 

  My requirement is like. I want to show the selected value in the TimePicker (it's binded with in the grid). 
  I have select the value in time picker and i moved to another cell, then  it's (TimePicker) not showing the selected value, it showing the previous value (value binded from DB)

I think you got my problem.

Please help me on this.

Regards
Satish
0
Rossen Hristov
Telerik team
answered on 23 Jul 2009, 12:48 PM
Hello satish,

I could not quite catch what the exact issue is.

It will be best if you send me a sample project (or if it will be easier -- you can modify the project that I sent you) and explain in great detail what are you trying to achieve and what is the exact problem.

In this way I will be able to help you fix your project as quickly as possible. I am looking forward to hearing from you.

All the best,
Ross
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
GridView
Asked by
Jack
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
satish
Top achievements
Rank 1
Vlad
Telerik team
Rossen Hristov
Telerik team
Share this question
or