In the grid i right also in english.
When i right string that represent a path, like: /home/dir/etc
In the grid it looks like: home/dir/etc/
The first '/' appears on the right side instead on the left side like it should be.
How can i fix the display of the string?
12 Answers, 1 is accepted
Please set the property shown below to move the plus sign (expansion sign) to the right:
this.radGridView1.RightToLeft = RightToLeft.Yes; |
I guess that you want to turn off Right-to-Left support for certain columns. Please see the code bellow:
private void radGridView1_CellBeginEdit(object sender, Telerik.WinControls.UI.GridViewCellCancelEventArgs e) |
{ |
if (e.ColumnIndex == 0) |
{ |
RadTextBoxEditor r = |
this.radGridView1.ActiveEditor as RadTextBoxEditor; |
if (r != null) |
{ |
r.RightToLeft = false; |
} |
} |
} |
In this case the first column has right to left turned off (columns collection is zero-based).
Do not hesitate to contact me if you have further questions.
Kind regards,
Nick
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Thank you for your answer. I will try this.
Why should I use an event?
Isn't there a way to set the specific columns to the left in the form_Load event in the begining of the application?
Thanks Yael
I tried this but the event CellBeginEdit is not fired.
In my form, the data is inserted into textBoxs that is bounded to BindingSource that is bounded to the RadGridView.
Is there a way to fire the event CellBeginEdit by 'OnCellBeginEdit'. I did not find an example to how to use this method.
Is there another way to use the RighToLeft property of the RadElement?
(Like in load event)
I also tried to use event 'CellFormating', but it didn't work (The RadTextBoxEditor r is = null).
Please help me
Yael
Thank you for your questions.
If you want to turn off Right-To-Left support for specific columns, there is no way to do that in the Form_Load event handler. Also custom firing of an event will not help for that.
Please see the attached sample project - I hope it will answer your questions.
Do no hesitate to contact me back if you need further assistance.
Sincerely yours,
Nick
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
You already gave me this example and i already tried it and it didn't work, because the event CellBeginEdit is not fired!!! (Sure i added the event & code you gave me to my application).
I asked you if the reasone for that is the way that i use the grid (quate: "In my form, the data is inserted into textBoxs that is bounded to BindingSource that is bounded to the RadGridView.").
And i asked if you can give me another solution.
You didn't answer my questions!!!
Please explain when does the event CellBeginEdit is fired?
What sould i do to make it fired???
Or can you give me another solution?
I am looking forwared for your answer
Yael
Hi Yael,
Thank you for contacting me back.
Unfortunately, I cannot find an alternative way to turn off RTL just in certain columns.
CellBeginEdit fires just when the user clicks in a cell to begin editing. I double checked that the CellBeginEdit fires. I do not have a clue why it is not fired when you reviewed my sample application. Can you send me a sample application demonstrating the issue so that I can research the reason? Perhaps it is a glitch that appears in very specific situations.
I cannot completely understand what you mean by "In my form, the data is inserted into textBoxs that is bound to BindingSource that is bound to the RadGridView". My guess is that you have some textboxes databound to your datasource and the the DataGridView is also bound to the same datasource. That should not be a problem.
All the best,
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
In my application the user never click on the cell to insert data.
The data is inserted through textBoxes and displayed in the GRID which is bounded to the BindingSource.
I think that this is the reasone that the event is not fired.
Is there a way to programaticaly make the event fired, like:
cell.BeginEdit;
Or something like that?
Thanks Yael.
I understand the issue more clearly now. Unfortunately there is no way to fire CellBeginUpdate, and you are correct - the event is fired only when the cell is edited from inside the grid.
Please try this event too:
private void radGridView1_CellFormatting(object sender, CellFormattingEventArgs e) |
{ |
if (e.CellElement.ColumnIndex == 0) { |
e.CellElement.RightToLeft = false; |
} |
} |
It changes the alignment for a specified column (the 1st one in the example above) and does not depend on editing the grid from the inside. I hope that helps.
Sincerely yours,
Nick
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Thank you. I tried it and it is working for all the rows in the Grid.
But my grid is hierarchy and i need this only on the child rows. and not on the parent rows.
Can you give me an example to do it?
Thank u
Yael
Thank you for your question.
Please see the example below:
private void radGridView1_CellFormatting(object sender, CellFormattingEventArgs e) |
{ |
if (e.CellElement.ViewTemplate.Parent != null) |
{ |
e.CellElement.ForeColor = Color.Blue; |
} |
} |
Do not hesitate to write me back if you have more questions.
Regards,
Nick
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
do you also encounter the problem i have in my grid( http://www.telerik.com/community/forums/winforms/gridview/style-problem-when-expanding-column.aspx)
if so, did you overcome it? any help would be much appreciated
Your question has already been answered in the other thread you have opened. Please see our answer there. You can find the thread in your Telerik account.
We kindly ask you to use one support channel to contact us. Posting the same questions several times slows down our response time.
Thank you for your understanding.
All the best,
Plamen
the Telerik team