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

First Impression

26 Answers 570 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Martin Nyborg
Top achievements
Rank 2
Martin Nyborg asked on 20 Nov 2008, 01:58 PM
Congratulations with the grid

I know that this is CTP, But there is some issues that I think that you have fix before one can use the grid.

-- Show stoppers --
Navigation
- Page up, page down is not working
- Tab from cell to cell

Edit a row
- when a user edits a row the user needs to be able to tab between cells

-- Next version please add --
Edit cell editors, date picker, combo

-- Themes --
The grouping band is very large and bulky. The users is not interested in seeing  the band but the data. And in general the SL themes are all created so the controls seems very large, like the combobox, default size 26 is VERY large, can you not create a more flat and condendsed theme for Silverlight.

Anyway it's looking better and better. And I hope that there is a more complete grid in january 2009 becuse we are starting a major SL project and need to trust that telerik is the right vendor for the SL controls

26 Answers, 1 is accepted

Sort by
0
Pavel Pavlov
Telerik team
answered on 21 Nov 2008, 05:17 PM
Hello Martin Nyborg,

Thank you for taking the time to evaluate the CTP of our RadGridView for Silverlight.
You are definitely right about the Tab navigation. Polishing the keyboard navigation is one of our priorities for the beta version (coming in the middle of December).

We already have combobox and datepicker editors for the cells. We are going to add those to some examples.

Themes for the Silverlight - the CTP is a preview only and a lot of work is to be done there. We are aware that compelling UI is a must for Silverlight development. Please stay tuned as our UX guys are investing a lots of efforts for the upcoming beta.

Thank you again for the constructive and positive feedback. It is of great value to us.
I have updated your Telerik points.

Kind regards,
Pavel Pavlov
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
nick
Top achievements
Rank 1
answered on 10 Dec 2008, 11:09 PM
I also have a major project coming up and need to know if you guys are up for it with your grid.

Can the grid be bound to a JSON object?
Can it handle Add, Delete, Update, ( if so how is this implemented?)
Can it handle keyboard navigation?
Does it support uppercase and lowercase data (including first character)

What makes your grid better then the standard Microsoft Data Grid and how would you compare it to Component Source data grid
and Infragistics data grid?
 




0
Milan
Telerik team
answered on 11 Dec 2008, 04:04 PM
Hello Nick,

First I would like to thank you for your interest in our products.

JSON support is more of a platform issue and luckily Silverlight has a build-in support for JSON. There are several classes that allow you to serialize/deserialize JSON data and also manipulate it. You can even use LINQ to dynamically access primitive JSON types. We are planning to publish an example demonstrating how one can use JSON data with RadGridView.

Yes our grid can handle data editing. We already have an example on our web page that demonstrates how you can add, delete, and update records in RadGridView. If you have any specific question about the editing capabilities of our grid control feel free to contact us.

We do support keyboard navigation in the currently published preview build, but we'll get that in place for our beta, scheduled next week.

I didn't quite get the question about uppercase and lowercase data. May I ask you to elaborate on your idea? Could you provide us with an example where such funtionality would be important?

I am not sure if I can provide the most unbiased comparison with one of the competitor products, I urge you to download the products and see for yourself. Right now, what I believe separates us from the crowd is our superior performance and the shared API that lets our customers target WPF and Silverlight with a single code base.

Regards,
Milan
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Richard H
Top achievements
Rank 1
answered on 13 Dec 2008, 12:14 AM
Also, I was wondering if you will also be adding any new filtering support (in addition to your current grouping support) in any future releases? I have seen other Silverlight Data Grid controls that provide very powerful column level filtering (similar to what you would see in Excel) that would be very useful to have included in the grid. While the grouping feature could be used to help filter through data, it is really not a filtering mechanism. While I realize this is a CTP,  this piece of functionality seems to be missing and I was wondering when we could expect something like this?
0
nick
Top achievements
Rank 1
answered on 13 Dec 2008, 10:38 AM
Hi,

Thanks for getting back to me so quickly and for the defensive answers.
My Q. about the first character was a concern because we once  used a Notibi ajax grid that we have had many problems with.
One of them was the that the first character would automatically be converted to lower case. I noticed on your demos that you didn't have this problem, so that is great, I hope your grid is hard to break and rock solid unlike the Notibi ajax grid and some other grids out there.

I guess your grid will have the auto column generete feature, therefore not requireing a grid defination in the xaml, this allowing a grid to be generreted on the fly (on the front end). This is what I need to do. The data will be loaded up in the behind code in JSON format (containing rows with records and coulm labels), How do I do this with your grid? Can you please provide me with an example. This is a fondermental requirement for our application.

Thanks Nick.


0
Milan
Telerik team
answered on 15 Dec 2008, 07:23 PM
Hi nick,

Our grid does will not alter the input data in any way, unless of course you configure it for such a scenario, and for that reason you shouldn't have problems like the one where the first character was converted to lower case.

Yes our grid has automatic column generation. It will automatically detect the fields (or columns) of your data and display the data properly.

I have prepared a sample application that demonstrates how you can use JSON data with our grid. The trick is to have a class that represents your data and deserialize the JSON data an a list of objects of that class.
For exmaple, if the JSON data represents people you would have a Person class. Upon deserialization the data will be transformed into a list of Person objects that our grid can bind to.
Althouth this might seem too complicated is can actually be achieved with just a few of lines of code using the Silverlight support for JSON.

I hope the application that I am sending you will be helpful.
If you have any questions feel free to contact us.

Sincerely yours,
Milan
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
nick
Top achievements
Rank 1
answered on 15 Dec 2008, 09:34 PM

Thanks! The example was great, and your grid looks fantastic, We are very impressed with the speed of your replies and we are looking into your pricing structure and other SL packages.

I have an issue with the ItemsSource of the grid, the normal way of loading this up will not work for me
ie:

  1. Define a class ( with setter and getter handlers)
  2. Create an instance of the class
  3. Set its data from JSON (or other source)
  4. Add that class to a LIST,
  5. Set the LIST as the ItemsSource of the grid

This method works fine if you know what the column names will be at run time, but I need the column names to be dynamic, I will not know
anything about them until run time therefore I cannot define a class for that maps to the column names.

How do you do this?

I have tried JSON object's toList method, ( this returns it in the wrong format, (KeyValuePair<string,string>[][]) "key" and "value" become column headers with the key being the JSON key and Value being the JSON value). The JSON value part contains another set of key and values, the column definition data, eg: c0:"Jack",c1:"black". Here's an example of the JSON format I am loading,

{
"r0":{"c0":"Jack","c1":"pack","c2":"Y","c3":"0800282828","c4":"027875155","c5":"123456","c6":"25","c7":"50000"},
"r1":{"c0":"Jack","c1":"pack","c2":"Y","c3":"0800282828","c4":"027875155","c5":"123456","c6":"25","c7":"50000"},
"r2":{"c0":"Jack","c1":"pack","c2":"Y","c3":"0800282828","c4":"027875155","c5":"123456","c6":"25","c7":"50000"}
"column_names":{"c0":"Row Id","c1":"Last Name","c2":"Has Kids","c3":"Phone Number","c4":"Cell","c5":"Work Ph","c6":"Age","c7":"Income"}
}

The last row should map to column names, and the other data should map for the values.

How do I do this?  What is the  most efficient way of structuring/ Loading the JSON data into your grid?

If I turn off auto column generate and create each column one by one, How do I do the binding from the behind code?
0
Milan
Telerik team
answered on 18 Dec 2008, 03:06 PM
Hello nick,

First I would like to apologize for the delay. The example that I have prepared for you took a lot of time and effort to develop, but I believe that it was worth the wait.

At the moment, there is no straightforward way of supplying ad-hoc JSON data to RadGridView. For that reason I have created a special class that takes JSON data and automatically transforms it into a data source tha our grid can use. As a result you do not have to create any mapping classes, like the Person class, that I have suggested in my previous response. 

All you need to do is to use DynamicData.CreateDataSourceFromJson and pass your JSON string. The DynamicData class will create a data source, based on the input JSON data, that you can bind to using our grid. The whole process is somewhat complex but it is executed behind the scenes by the DynamicData class.

There are two important methods of the Dynamicdata class that I would like to describe in more details. The first is the CreateDataSourceFromJson that I have already mentioned. This method is dependent on the JSON data structure, meaning that it currently works only with the JSON format that you have provided in your last post.

If the format changes CreateDataSourceFromJson should be tweaked. CreateDataSourceFromJson reads the input JSON and transforms the data into a format that can be consumed by the CreateDataSource(IList<IDictionary> data) method.

CreateDataSource does the real job of creating the data source and it is not dependent on the JSON format. The method receives a list of Dictionary objects that represent all data items. Those dictionaries define what properties each data item should have, how many data item should we create, etc.

Every dictionary in the list represents a single data item. The keys of every dictionary define the number and the names of the actual properties. For each key, of course, there is a coresponding value. The values in the dictionary are the actual values of the properties for their respective data item.

Here is a more visual example:
Let's say we have the following JSON
{"r0":{"c0":"Jack","c1":"Jack"},   
"r1":{"c0":"Ginio","c1":"Paraskevov"},    
"column_names":{"c0":"First Name","c1":"Last Name"}} 
CreateDataSourceFromJson will transform (or deserialize) that JSON into a list of 2 dictionaries. The first dictionary corresponds to
{"c0":"Jack","c1":"Jack"} 
and the second one corresponds to
{"c0":"Ginio","c1":"Paraskevov"
After the transformation the list of dictionaries will look like this:
1st dictionary:
["First Name", "Jack"]
["Last Name", "Jack"]
2nd dictionary:
["First Name", "Ginio"]
["Last Name", "Paraskevov"]

After those dictionaries are passed to CreateDataSource, the method will use them to create the actual data source.

I have attached a sample project that demonstrates how the DynamicData class works with 2 sets of different JSON data, and I hope that the class will be very helpful in your scenario.
Once again thank you for your patience.

Sincerely yours,
Milan
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
nick
Top achievements
Rank 1
answered on 27 Dec 2008, 02:37 PM
Thanks very much for the code you have prepared, and sorry about the late replay, I have tried to open the project in visual studio but it gives me some type of link error, any ideas? I have been through the code and and tried creating a new project with no luck.
0
Milan
Telerik team
answered on 27 Dec 2008, 10:15 PM
Hi nick,

Could you be more specific about the error that you are getting?
I remeber getting a similar error and the solution was to simply rebuild and re-run the sample application.

Best wishes,
Milan
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
nick
Top achievements
Rank 1
answered on 05 Jan 2009, 02:39 AM
Hi,

I have tried rebuilding and running the sample app you built, it does not run, during design time in visual studio I get the following error


Error HRESULT E_FAIL has been returned from a call to a COM component.
   at MS.Internal.XcpImports.CheckHResult(UInt32 hr)
   at MS.Internal.XcpImports.RenderTargetBitmapRender(HostingRenderTargetBitmap bitmap, UIElement visual, Int32& dirtyX, Int32& dirtyY, Int32& dirtyWidth, Int32& dirtyHeight)
   at System.Windows.Interop.HostingRenderTargetBitmap.Render(UIElement visual)
   at MS.Internal.Silverlight.Host.RuntimeInterop.RenderElementToTargetBitmap(Int32 elementKey, Int32 targetBitmapIdentifier)
   at MS.Internal.Silverlight.Host.Interop.RenderElementToTargetBitmap(Int32 element, Int32 targetBitmapIdentifier, ISilverlightContentDownloadCallback urlcallback)
   at MS.Internal.Silverlight.Host.CiderSilverlightImageHost.CiderInternalImage.UpdateBitmap()
   at MS.Internal.Silverlight.Host.CiderSilverlightImageHost.CiderInternalImage.UpdateTree()
   at MS.Internal.Silverlight.Host.CiderSilverlightImageHost.CiderInternalImage.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.ContextLayoutManager.UpdateLayout()
   at System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)
   at System.Windows.Media.MediaContext.InvokeOnRenderCallback.DoWork()
   at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
   at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
   at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)

 
Error HRESULT E_FAIL has been returned from a call to a COM component.
   at MS.Internal.XcpImports.CheckHResult(UInt32 hr)
   at MS.Internal.XcpImports.FrameworkElement_MeasureOverride(FrameworkElement element, Size availableSize)
   at System.Windows.FrameworkElement.MeasureOverride(Size availableSize)
   at Telerik.Windows.Controls.GridView.GridViewDataControl.MeasureOverride(Size availableSize)
   at System.Windows.FrameworkElement.MeasureOverride(IntPtr nativeTarget, Single inWidth, Single inHeight, Single& outWidth, Single& outHeight)


When I try and run it, I get the following error when clicking the Load JSON DATA button:

Unhandled Error in Silverlight 2 Application Value cannot be null. Parameter name: jsonString at System.Json.JsonValue.Parse(String jsonString) at JSONedRadGridView.DynamicData.CreateDataSourceFromJson(String jsonData) at JSONedRadGridView.Page.ButtonData1_Click(Object sender, RoutedEventArgs e) at System.Windows.Controls.Primitives.ButtonBase.OnClick() at System.Windows.Controls.Button.OnClick() at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e) at System.Windows.Controls.Control.OnMouseLeftButtonUp(Control ctrl, EventArgs e) at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, String eventName)

You have been a great help to me and our company but I need to chicken test the integration of your grid and cannot go any further until i work this out.

A show starter for us is also Keyboard Navigation.

I checked out your blog and noticed the new update for the RadGrid but it didn't say it had keyboard navigation fixes.

We need the TAB key to work and the ARROW KEYS (up, down, left and right) to work. We need these so the user can navigate between cells without use of the mouse.

Does something need to be done with the model or have I missed something simple?  Could you please provide me a piece of code that allows these keys to work so I can show my compnay a good Chinken test so a final desceion can be made?

 
Thanks
Nick

0
nick
Top achievements
Rank 1
answered on 06 Jan 2009, 05:27 AM
Hi,

I have solved the problem. I was using Fire Fox 3 and then if I click the load JSON data button an error would occur, but IE 7 worked perfectly. I didn't think about opening it in there since I believed Silverlight was cross browser but in the end i did think about that. So thanks very much again for the demo.

I worked out what needed to be done in FF to make it work:
just change the behind code in the events for both buttons from:
    getAttribute("value");
    to
    (string)getProperty("value");

The grid does not show up in design view still, I get the first error mentioned above, it does not effect the run time, is there a way to make Visual studio show the grid at design time?

We still need "tab" key support and the arrow keys to work, 
We need tab to allow the user to tab to the next cell, once the last cell is reached we need it to give focus to the first cell on the left on the next row. SHIFT tab would also be good. 

Thanks Milan  again for the code and help you have been.





0
Pavel Pavlov
Telerik team
answered on 07 Jan 2009, 04:00 PM
Hello nick,

I have checked the design time issue. It is a bug present in the beta release. This one has already been fixed so it will be ok in our next release.

Tab and arrow navigation for our RadGridView for Silverlight is a challenge we are currently working on.
Once ready it will work exactly the way you described.
Again we plan to add these features for the next release (Q1 2009 planned for the second half of February).

If meanwhile, any of these are critical to you, please let us know so we can think of some workarounds.

Best wishes,
Pavel Pavlov
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
nick
Top achievements
Rank 1
answered on 09 Jan 2009, 05:13 AM
Hi,

The tab and keyboard working is a critical feature for our application, if you had some workaround code it would be great until the new release is ready, if you would like we can beta test it if you give us an early release,

another Q1: Will your grid support dbl click event?
another Q2: How would you detect new/ modified records and send them to the server for storage using JSON format above?

0
Hannes
Top achievements
Rank 2
answered on 09 Jan 2009, 09:11 AM
I've had the following things that I found 'missing', I'm sorry if I'm stating the obvious:

- Removable row headers
- A possibility to 'thighten' the border around the actual grid, because there's still quite some bulk space around it
- Header styles/templates
0
Hristo Deshev
Telerik team
answered on 12 Jan 2009, 04:27 PM
Hi everyone,

@Nick

Re Q1: We do have an internal solution that captures double clicks on some elements and use that to implement some of the features, say double clicking the border between header cells to perform auto-fit. Since Silverlight is a bit crippled in that area, we are reluctant to expose a non-standard event such as double click. You can help us decide -- what is your favorite scenario that you absolutely need double click for?

Re Q2:
You need to use the row EditEnded event and collect the modified data objects. Once you need to commit those to the DB, you just need to loop over the stored objects. Here's some sample code:

public Page() 
    InitializeComponent(); 
 
    this.RadGridView1.ItemsSource = GetMessages(); 
    this.RadGridView1.ValidationMode = ValidationMode.Row; 
    this.RadGridView1.AddHandler(GridViewRow.EditEndedEvent, new EventHandler<RecordRoutedEventArgs>(this.OnEditEnded)); 
 
private List<Message> editedMessages = new List<Message>(); 
 
private void OnEditEnded(object sender, RecordRoutedEventArgs e) 
    var editedMessage = (Message) ((DataRecord) e.Record).Data; 
    this.editedMessages.Add(editedMessage); 

I am attaching a sample project.

@Hannes
  • You can hide the column headers by setting the ShowColumnHeaders to false.
  • You can set a column's header cell style or template by assigning the respective column's HeaderCellStyle property.
  • I assume you are talking about the visible padding around the RadGridView inner objects: rows, header, etc. Unfortunately, removing that is a matter of editing several controls' templates, and the only way to do that is to edit the default theme yourself (which is not possible at the moment). I think you must wait until the next release that will have theming and theme editing support.

Thanks!

Greetings,
Hristo Deshev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
nick
Top achievements
Rank 1
answered on 12 Jan 2009, 09:41 PM
Hi,

Thanks for the example, it will really help!!

Answers:

  1.    I need to capture the dbl click event when the user dbl clicks a row in the grid.
      (upon this event I'm going to pop up a new window, possibly a RadWindow with
      other Rad controls inside.

Questions:

1.   Can you please give me an  example of putting your radGrid in a radWindow?
I checkout: http://www.telerik.com/help/silverlight/radwindow-using-user-control-with-radwindow.html but could not get it to go,
if you have a coded up example of that page it would be exactly what i need, as we are thinking of replacing all our dhtml windows with your RadWindow.

2.   Has anyone had any luck on the tab key?

3.  Can  you give us an early release of your next version if we beta test it for you?

Thanks again for your help!


Nick
0
Hristo Deshev
Telerik team
answered on 14 Jan 2009, 02:04 PM
Hello Nick,

Thanks for your input. We are still debating whether to support that event.

I am attaching a sample project that displays a RadGridView inside a RadWindow object. Note that you need to have the PreviewClosing RadWindow event handled like this:

void window_PreviewClosed(object sender, WindowPreviewClosedEventArgs e) 
    this.Focus(); 
 
 

The above works around a Focus-related bug that crashes the RadGridView in the current beta build.

We are still working on the tab key support and we can post a preview build once we have something to show. Stay tuned!

Sincerely yours,
Hristo Deshev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
nick
Top achievements
Rank 1
answered on 15 Jan 2009, 05:06 AM
Hi Hristo ,

Thanks allot for the RadWindow demo, Great!
Your  RadWindow is very impressive and it looks like you are ahead of the crowd on this one!

Q. 1:  How do I free the memory?

          I noticed that after a RadWindow is closed task Manager tells me the memory is not freed
          So that after a few RadWindow's have been opened the memory builds up.
          What can I do, to free the memory and stop the memory leak?

Q. 2:  (Error on window close in Fire Fox - not critical)
       
        Even though this is not critical i'll inform you anyway:
        After Opening windows in Fire Fox (FF) and closing them an error occurs,
        and all  the windows disaprear). We would like to use FF in the future and if your Rad Componets would work in FF it would be very
        nice.  Do  you plan to support FF?


Thanks again Hristo  for the sample code, fully appreciated.







0
Serrin
Top achievements
Rank 1
answered on 15 Jan 2009, 02:29 PM
Hey nick,

Not sure what it defaults to, but perhaps if the default behavior for window.closeMode is Hide, that would explain the memory usage.  What happens if you add a:

window.CloseMode =

CloseMode.Close;

to your code, any noticable memory difference? :)

Can't speak for the FF problem though, that's one for the pro's.

 

0
nick
Top achievements
Rank 1
answered on 15 Jan 2009, 09:33 PM
Hi,

I have tried putting the close mode on close , but it seems to still not release the memory, got any other ideas?

Nick
0
nick
Top achievements
Rank 1
answered on 10 Feb 2009, 07:11 AM
I Just had a quick Question,

How do I access the DynamicType Object at design time?

What I want to do is set the CreateDataSourceFromJson not directly on the grid Data source but on another object ( what object should this be)? . I think it should be a list object of type ( DynamicType) but I can't use DynamicType becuase it does not exists at design time.

I need to do this  So then I can modify the the grid's data. Like delete. So if i remove an object from the data source ( the model) it should update the view ( the grid), same thing goes for modify and add operations.

Thanks
Nick


0
Stefan Dobrev
Telerik team
answered on 10 Feb 2009, 05:00 PM
Hello nick,

Currently, the example creates a generic list (List<>) for the data source. I have modified the sample to return an ObservableCollection that will allow for collection change notifications. I have also added a button that demonstrates how to remove the first item from the collection.

Hope this will help.

Greetings,
Stefan
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
nick
Top achievements
Rank 1
answered on 02 Mar 2009, 07:39 AM
Hi,


How can i create an instance of a dynamic data type row? so I can wok with the grids data source?

Thanks
Nick









0
D. Omar
Top achievements
Rank 1
answered on 24 Mar 2009, 03:32 PM
I downloaded the trial a couple of days ago and it does not look like the Tab Navigation made it. Is this correct? I mean, I can tab to navigate to the next cell but I still have to click on it to edit the cell contents. Is tehre a way to have tab navigate to the next cell and go into edit mode after landing on that new cell?

Thanks in advance,

OmarV
0
Vlad
Telerik team
answered on 24 Mar 2009, 03:51 PM
Hello D. Omar,

This will be available in our first service pack (after two weeks).

Regards,
Vlad
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
Tags
GridView
Asked by
Martin Nyborg
Top achievements
Rank 2
Answers by
Pavel Pavlov
Telerik team
nick
Top achievements
Rank 1
Milan
Telerik team
Richard H
Top achievements
Rank 1
Hannes
Top achievements
Rank 2
Hristo Deshev
Telerik team
Serrin
Top achievements
Rank 1
Stefan Dobrev
Telerik team
D. Omar
Top achievements
Rank 1
Vlad
Telerik team
Share this question
or