This is a migrated thread and some comments may be shown as answers.
Questions about get_itemIndexHierarchical() and Row heights
8 Answers 96 Views
This is a migrated thread and some comments may be shown as answers.
Vlad
Top achievements
Rank 1
Vlad asked on 12 Jun 2008, 09:18 PM
Hi!

In your right-click menu example you have this line -
sender.get_masterTableView().selectItem(sender.get_masterTableView().get_dataItems()[index].get_element(), true);

it fails for hierarchical grids because index is a string like 0:0_0
Is there any way to make this work? I have a grid with two grids inside of it and while I click on a grid and get the menu, on the subgrids I get an error.

Another question is this. How can I limit height of boundgriditem in the grid view mode and make it expand in edit mode? So if the column is song lyrics we only show the first line but if we click edit then the whole lyrics shows up.

Thank you.

8 Answers, 1 is accepted

Sort by
0
Vlad
Top achievements
Rank 1
answered on 13 Jun 2008, 04:09 PM
anybody? :)


0
Sebastian
Telerik team
answered on 16 Jun 2008, 12:47 PM
Hello Vlad,

I think that the link to the code library entry (at the bottom of the Description section of the same demo) can help you implement context menu in a hierarchical grid:

http://www.telerik.com/community/code-library/submission/b311D-kmaah.aspx

For the second case I suggest you use auto-generated or custom edit form which will display the editable data under the corresponding edit grid row. To limit the size of the column in view mode, consider setting fixed width for the columns/MasterTableView -> TableLayout = Fixed in combination with column resizing enabled:

http://www.telerik.com/DEMOS/ASPNET/Prometheus/Grid/Examples/Client/Resizing/DefaultCS.aspx

Best regards,
Stephen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Vlad
Top achievements
Rank 1
answered on 16 Jun 2008, 02:15 PM
The first demo is for old version, it doesn't work with new AJAX grid.

Second I actually meant rows not columns, sorry. Where would I set proper row height? I tried in master table but that didn't work.
0
Sebastian
Telerik team
answered on 16 Jun 2008, 02:20 PM
Hi Vlad,

Each sample project in the code library thread has version (with _Web_UI suffix) attached - let me know if I am missing something obvious.

For the second part:
Consider enabling row resizing as shown in the online example from my previous post and set height for the items to see whether this helps.

Best regards,
Stephen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Vlad
Top achievements
Rank 1
answered on 16 Jun 2008, 03:04 PM
Thank you for your answers.

I did get add/edit/delete working, I have a questions about delete -
(tableView as GridTableView).PerformDelete(((tableView as GridTableView).Items[radGridClickedRowIndex] as GridDataItem));

is there any way to automate confirmation popup like in aspx?

...ConfirmText="Are you sure you want to delete this Entry?"
                            ConfirmDialogType="Classic" ConfirmTitle="Delete" ...


Also, where exactly would I set row height?

Thanks
0
Sebastian
Telerik team
answered on 17 Jun 2008, 11:20 AM
Hi Vlad,

In order to show confirmation dialog when delete operation is triggered, consider intercepting the OnClientItemClicked client event of RadContextMenu and show the browser confirm from within its handler.

Concerning your second question:
To set the row height use the ItemStyle-> Height and AlternatingItemStyle -> Height properties of the grid/master table.

Best regards,
Stephen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Vlad
Top achievements
Rank 1
answered on 17 Jun 2008, 01:59 PM
Thanks.

I tried doing this -
            <ItemStyle Height="20px" />           
            <AlternatingItemStyle Height="20px" />

but my rows still stretch to the size of text inside GridHTMLEditorColumn or GridBoundColumn whichever is larger.

TableLayout is set to fixed. Column resizing is enabled.
0
Sebastian
Telerik team
answered on 18 Jun 2008, 07:01 AM
Hi Vlad,

Have you enabled the row resizing for the grid as well (choosing ClientSettings -> Resizing -> AllowRowResize = true)? You may also check whether switching the table layout of the grid to Auto makes a difference.

Regards,
Stephen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Grid
Asked by
Vlad
Top achievements
Rank 1
Answers by
Vlad
Top achievements
Rank 1
Sebastian
Telerik team
Share this question
or