How to acces a DatePicker in a Grid

6 posts, 1 answers
  1. Juan Camilo zapata
    Juan Camilo zapata avatar
    15 posts
    Member since:
    Dec 2009

    Posted 23 Jan 2010 Link to this post

    Hi, i have the following code, and what I want is that RadDatePicker "picker" is accessible from the code. Try typing in code, picker and does not recognize it, if can help me to give some properties to the DatePicker. I have a grid, and there declare an datepicker for a date, I do so because I have a template for the datepicker.
    Thank you very Much

    <telerikGridView:GridViewDataColumn Header="Date"  > 
                        <telerikGridView:GridViewDataColumn.CellTemplate> 
                            <DataTemplate> 
                                <TextBlock Text="{Binding Date}" /> 
                            </DataTemplate> 
                        </telerikGridView:GridViewDataColumn.CellTemplate> 
                        <telerikGridView:GridViewDataColumn.CellEditTemplate> 
                            <DataTemplate> 
                                <telerik:RadDatePicker x:Name="picker" DayTemplate="{x:Null}" /> 
                            </DataTemplate> 
                        </telerikGridView:GridViewDataColumn.CellEditTemplate> 
    </telerikGridView:GridViewDataColumn> 
  2. Juan Camilo zapata
    Juan Camilo zapata avatar
    15 posts
    Member since:
    Dec 2009

    Posted 27 Jan 2010 Link to this post

    there is someone who can help me?
  3. DevCraft banner
  4. Kaloyan
    Admin
    Kaloyan avatar
    920 posts

    Posted 28 Jan 2010 Link to this post

    Hi Juan Camilo zapata,

    The CellEditTemplate property is of DataTemplate type. This means that every control placed in DataTemplate appears in different visual tree then the main one. That's why there is now way to access any controls placed in it(DataTemplate).

    Regards,
    Kaloyan
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  5. Juan Camilo zapata
    Juan Camilo zapata avatar
    15 posts
    Member since:
    Dec 2009

    Posted 28 Jan 2010 Link to this post

    Hi Kaloyan, the truth did not quite understand your reply. You said "That's why there is now way to access any controls placed in it", or what you meant was "That's why there is no way to access any controls placed in it". If is can be done, can guide me how to do it.
    Thanks
  6. Answer
    Kaloyan
    Admin
    Kaloyan avatar
    920 posts

    Posted 01 Feb 2010 Link to this post

    Hello Juan Camilo zapata,

    What i mean is  that the Silverlight runtime will not recognize the element with x:Name placed inside the DataTemplate. This is due to the framework restriction. Nonetheless you can obtain a reference to the element using the VisualTreeHelper. Find the posted link with a demonstration of this approach.

    Sincerely yours,
    Kaloyan
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  7. Juan Camilo zapata
    Juan Camilo zapata avatar
    15 posts
    Member since:
    Dec 2009

    Posted 01 Feb 2010 Link to this post

    Kaloyan, thank you very much, helped me a lot your information.
    Greetings
Back to Top
DevCraft banner