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

Blank character in GroupPanel Exception

3 Answers 90 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Lasly
Top achievements
Rank 1
Lasly asked on 09 Aug 2011, 08:46 AM
Hello everyone,
I have a RadGrid with autogenerated columns, I set a datasource with the column names with spaces.
(example: "id ue", "number boxes", etc.).


My problem occurs when I drag a field in the group panel.


"Field id not found in the source table" in reality the field is not "id" but "id ue" ... but the blank character generates exception in the group panel.




Can you help me?


thanks


Best Regards


Lasly 

3 Answers, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 12 Aug 2011, 08:30 AM
Hello Lasly,

You can use SQL alias when performing the select command. So instead of
SELECT [id ue] FROM TABLENAME;
 
you can use
SELECT [id ue] AS ID FROM TABLENAME;

This way you should succeed, but nevertheless try to avoid using spaces in column names, because is considered bad practice.

Also you can view the description section of our online demo for additional information.

All the best,
Andrey
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Lasly
Top achievements
Rank 1
answered on 12 Aug 2011, 09:51 AM
Hello Andrey,
thanks for reply,

but I had too much summed up question and I have not explained well.
My physical column of sql server has no spaces of course, I purposely give it an alias with space.
(select idue as [id ue] from nametable) Mine was a ascamotage.

 I'll explain:
I have a page a radgrig with  autogenerated columns. This page receives as a parameter the name of a view and returns all records graphically. I had to quickly add a view, but, unlike the others, this need of column names (of RadGrid) with a space. I had to add
an extraction without having to change the encoding ... so I added the alias [id ue] to the field. (I could not call it id because it was not explanatory and  I could not call id_ue or idue because it was ugly). With the alias everything was ok quickly, except the group panel .
(
My problem occurs when I drag a field in the group panel. "Field id not found in the source table" in reality the field is not "id" but "id ue" ... but the blank character generates exception in the group panel.)

In the end I changed the code (c # set HeaderText dynamically - good practice :-)  but bad slow for emergencies  :-(        )
I rebuilt and republished, for the customer.

It was interesting to know if you could solve the problem of group panel with the blank spaces from columns' aliases.

Tanks

sorry for my english


Lasly

0
Accepted
Andrey
Telerik team
answered on 15 Aug 2011, 01:16 PM
Hi Lasly,

Unfortunately, having a blank space in column's header when grouping is enabled is not supported scenario. There are two approaches that could be followed in such case. The one that you have implemented, which can be used with AutoGeneratedColumns and with declaratively defined columns. The other is to set FieldAlias  for the field's name in which you have a black space, but this approach, could be used with declaratively defined columns only. A live example, how this can be achieved is available here.

If you need further assistance, do not hesitate to contact us.

Regards,
Andrey
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
Grid
Asked by
Lasly
Top achievements
Rank 1
Answers by
Andrey
Telerik team
Lasly
Top achievements
Rank 1
Share this question
or