end-user customize visible columns

6 posts, 2 answers
  1. Marcel
    Marcel avatar
    25 posts
    Member since:
    Jan 2011

    Posted 20 Sep 2012 Link to this post

    Before I write new code, I wonder if it already exists? My end-user wants the ability to select the columns that are to be visible in the grid from a popup list of columns with check boxes next to each column name. They select the columns they want to see.

    Does Telerik Silverlight offer something like this OOB?
    Thank you
  2. Answer
    Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 21 Sep 2012 Link to this post

    Hello,

     There is no such built-in functionality however we have an example which may help you in your case. 

    Regards,
    Vlad
    the Telerik team

    Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.

  3. Answer
    Josh
    Josh avatar
    27 posts
    Member since:
    Feb 2012

    Posted 25 Sep 2012 Link to this post

    We were easily able to implement something similar to this with the following:

    <ListBox ItemsSource="{Binding ElementName=PART_grid, Path=Columns}" MinHeight="150" MaxHeight="150">
         <ListBox.ItemTemplate>
              <DataTemplate>
                  <StackPanel Orientation="Horizontal">
                       <CheckBox IsChecked="{Binding Path=IsVisible, Mode=TwoWay}" />
                       <TextBlock Text="{Binding Path=Header.Text}"  />
                   </StackPanel>
              </DataTemplate>
         </ListBox.ItemTemplate>
    </ListBox>


    It's worth noting that the all of our headers are TextBlocks. 
  4. Marcel
    Marcel avatar
    25 posts
    Member since:
    Jan 2011

    Posted 26 Sep 2012 Link to this post

    Hi Josh, Vlad

    Vlad, the example you showed was good but the code is abstracted away. Can you provide the code?

    Thanks Josh - it's working. My listbox was not showing the column names - I had to remove '.Text' from the pasted line.

    <TextBlock Text="{Binding Path=Header.Text}" 
  5. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 27 Sep 2012 Link to this post

    Hello,

     I'm not sure I understand. Have you checked the code of the demo? You can click the "code" button in the top right part of the demo. 

    Greetings,
    Vlad
    the Telerik team

    Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.

  6. Marcel
    Marcel avatar
    25 posts
    Member since:
    Jan 2011

    Posted 27 Sep 2012 Link to this post

    Hi Vlad,
    You were right - all the code was there and I got it working on my end. This is a very nice solution. THANK YOU.

    For anyone intertested, I couldn't find a way to copy the code from the online example, BUT the code is available on your hard drive in the demos\examples folders.
Back to Top