GUID column

5 posts, 0 answers
  1. Dave
    Dave avatar
    9 posts
    Member since:
    Nov 2006

    Posted 27 Apr 2007 Link to this post

    I have a data table with a GUID column I am binding to the grid view.  After setting the data source, I am programmatically setting a group by expression, setting the column type for the GUID column to System.Guid and hiding the GUID column.  I have also enabled autosizing on all columns as well as on the master table.

    Problems:

    (1) As I scroll through the grid, seemingly randomly some rows display a portion of the hidden column.  There is no rhyme or reason to it - scroll to the bottom, and then back to the top and the first row shows part of the hidden column.  Scroll just enough until the column is off display and then back, and sometimes the hidden column is gone, other times not.

    (2) Nothing I do, no property I set, nothing will cause the columns to autosize.  They all reset back to 50 wide.  I can resize the columns manually and they stay.  But nothing will make them columns start out properly sized, including setting column widths when defining the master table layout.

    (3) When issue 1 happens on any row, the columns for that row are no longer aligned with the column headers.  When the hidden column disappears again, the columns are properly aligned with the headers.

    (4) I can't find any way to add a "command" type column to the grid.  I want to be able to add a column like the normal data grid view control where the user can click the text which appears like a hyperlink and have some action occur.  Is this not a feature or am I just missing something?

    I am using Q1 2007.  HELP!  What am I doing wrong?  I REALLY want to use this control because of the display properties, but these seem like pretty big issues to me. 

    -Dave Ferreira
  2. Dave
    Dave avatar
    9 posts
    Member since:
    Nov 2006

    Posted 29 Apr 2007 Link to this post

    Following up on the "command" type column:

    Programmatically I am trying to add a RadGridViewButton column.  I create an instance of the class, fill out the properties I want, and then am stalled trying to find a way to add this column to the MasterGridViewTemplate.  Seems that the Add and Insert methods of the columns collection only take the GridViewColumn class (there is an overloaded method which takes an object, but it doesn't seem to be implemented as I get stuck with an error as it tries to cast my instance as a GridViewColumn at run time).  As this is an abstract class, and as there are no methods to get the control to return a new column, I am pretty well stuck. 

    Looking over the minimalist documentation, I can't see ANY way to add rows and columns at run time.  What am I missing here, or is this strictly a data bound control? 

    -Dave Ferreira
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Dave
    Dave avatar
    9 posts
    Member since:
    Nov 2006

    Posted 30 Apr 2007 Link to this post

    Another follow-up:

    OK, so I figured out how to add columns.  Problem is, I am limited to the same few columns that I get in the column editor.  There appears to be nothing to create any sort of command column.

    Also, it would appear that when I add a column to a data bound grid, I can't set any values in that column.  There are no errors, but it just does not work.  I have tried a refresh after setting values - nothing.

    So I am really floundering here.  Can anyone offer any help?

    -Dave Ferreira
  5. Dave
    Dave avatar
    9 posts
    Member since:
    Nov 2006

    Posted 30 Apr 2007 Link to this post

    Good God, nothing should be this difficult!

    Looking at the source, I built a routine to autosize the columns.  The issue now is that it only will resize the column based on the currently visible items in the grid, not items which may be scrolled off the screen at the time.  My guess this is because the grid has not completed loading (the documentation suggests that there is an ItemDataboundComplete event - or something named like that - but it is not defined in the code, so I have no way of knowing when all of the rows are bound).  So, as the user scrolls through the grid, they must repeatedly double-click the margin between columns to force the resize on the visible items in that column only.

    Here are my issues as they stand now:

    (1) Is there a command column type and if not, how can this be achieved using the current column types?

    (2) Is there some event which will clue me in to the fact that all the data is bound so I can call my custom routine to resize?  Inherint in this is the need to be able to loop through EVERY data cell to calculate the size the cell should be and change the column width to match.  So does looking through the children of the table body element only yield the items visible on screen at present or is there some other way to get at ALL data cells?

    (3) Is there a workaround for the unbound column issue?  If I add a column in the designer which is not bound to a field in my data table and that column is visible, scrolling through the grid causes the hidden (data bound) column to randomly display some of its content.  Same thing is true if I add the column through code either before or after data binding.

    -Dave Ferreira
  6. Kiril
    Admin
    Kiril avatar
    158 posts

    Posted 02 May 2007 Link to this post

    Hello Dave,

    Thank you for your bug-reports and suggestions.

    The command column feature is on our to-do list for Service Pack 1. Unfortunately, there is no event raised when all items are data bound. This issue, will be addressed in SP1 too, as well as the fix for the column auto-sizing and unbound column issues. You account was updated with Telerik point, for the time and effort dedicated to improving the quality of our products.

    All the best,
    Kiril
    the telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top
UI for WinForms is Visual Studio 2017 Ready