Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
285 views
I have a grid with a GridButtonColumn like this one:

<telerik:GridButtonColumn CommandName="delete" Text="Delete" UniqueName="delete" ConfirmText="Are you sure you want to delete this item?">  
    <HeaderStyle Width="30px" /> 
    <ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False" Font-Underline="False" ForeColor="#182B45" Wrap="True" /> 
</telerik:GridButtonColumn> 

The DataTable associated with this Grid contains a column "DELETE" which either contains the entry "true" or "false" for each row.

What I now want to do is: the item in the above shown GridButtonColumn should be enabled/visible ONLY if the associated DataTable-entry shows the entry "true" for the row.

So what I apparently need is an iterator over the Grid and over the DataTable doing something like
for each item of datatable
if (dataTable.Item["Delete"].Equals("true") RadGrid1.Item[][].Disabled

How can that be done
Shinu
Top achievements
Rank 2
 answered on 07 Jul 2008
4 answers
94 views
I have a toolbar item which fires a command. The code executed is:

RadGrid1.AllowFilteringByColumn = true;

If I set this value to true declaratively - everything works. When I set it dynamically I get strange results (first time nothing happens, second time filter items are displayed - but it won't display the filter menus).

Any ideas?
Rosen
Telerik team
 answered on 07 Jul 2008
1 answer
114 views
Does RadGrid for AspnetAjax support the LinqDataSource? If not now, will it do so in the future?

Does RadGrid for AspnetAjax support a DataSource set to a custom-coded LINQ query expression written in a codebehind file?

Does RadGrid for AspnetAjax support multiple nested detail levels for a LINQ query expression? In other words, a master, then a nested detail1, followed by a nested detail2 with a LinqDataSource or custom-coded LINQ query expression?

Thanks for answers with pointers to working demos?
Shinu
Top achievements
Rank 2
 answered on 07 Jul 2008
0 answers
159 views
Hello,
maybe i'm a bit off-topic, but i couldn't find a solution anywhere else.
I want to create a webservice that returns, using google maps api, driving distance betwen to cities.
Js code is quite simple:
  map = new GMap2(document.getElementById("map_canvas"));  
  map.setCenter(new GLatLng(42.351505,-71.094455), 15);  
  directionsPanel = document.getElementById("route");  
  directions = new GDirections(map, directionsPanel);  
  directions.load("500 Memorial Drive, Cambridge, MA to 4 Yawkey Way, Boston, MA 02215 (Fenway Park)"); 
 
i can exclude the part to show the map...
i also need to add a js event handler:
GEvent.addListener(directions, "load", onGDirectionsLoad); that retrieve the distance.

The problem is that i have no idea how to use this code inside a asmx

Is this possible ? What alternatives do i have ? WebRequest ? 

thanx

Lorenzo Castrico
Top achievements
Rank 2
 asked on 06 Jul 2008
0 answers
57 views
Nevermind... I had an issue I figured out...error on my end.  ;-)

Thanks!

Michael
Michael
Top achievements
Rank 1
 asked on 06 Jul 2008
2 answers
196 views
From my code-behind, I would like to specify a "default" file path and name for the user, and present this default in the first file input box. 

How do I accomplish this?

Thank you,

David Nowak.
TonyG
Top achievements
Rank 1
 answered on 05 Jul 2008
5 answers
312 views
Hello,

Background: I have toolbar, paged grid, and the form (actually user control) to edit records outside the grid. Usual flows are:
1. User clicks on grid row, I fill the form with the selected row data, user see it. He can then edit data and click Save button on toolbar. Data has been saved and grid has been rebinded then.
2. User clicks Add button on the toolbar, I clear the form out. User enters data and clicks Save button on the toolbar. Data has been saved and grid has been rebinded again.

After the grid has been rebinded, I must select the row (which was just edited or added) programmatically using Grid.SelectedIndexes.Add... (first I determine required page index and row index on page of course).

Everything works great unless changed or added row appears within currently selected grid page after rebinding (e.g data is sorted alphabetically in database query, no sorting in the grid itself, and new record may or may not appear in the currently selected grid page after rebind).

What I can: determine required page index from the underlying dataset (which is possible only when there is no sorting in grid abd is just a workaround that I don't like very much, but no other way found in your help/forums, but it's a subject for another discussion).

I.e. I have all information in my code required to set the corresponding page index. The final step left: select required page (knowing it's index) in the server code behind.

I tried to set Grid.CurrentPageIndex in PreRender event handler as well as just after data reload - nothing works for me. It seems that content to render inside the grid has been created before PreRender event so setting CurrentPageIndex doesn't change anything - after request, I see the old page selected despite of the index I'm setting.

Any way to get what I need (i.e. set selected page of paged grid in code behind and see THAT grid page in browser)?

Please note that switching grid paging off is not an acceptable approach for me: having hundreds or thousands records in dataset, it takes too much time to load page when everything is shwon at time.

Or if I rephrase the question: how to select a row in paged grid, which is located on a page which is not currently selected page in the grid, programmatically?
Evgeny
Top achievements
Rank 1
 answered on 05 Jul 2008
1 answer
77 views
Can someone at telerik tell me their opinion on if it is a good idea to use a grid control for a form?

As in a user goes to a page and is presented with a horizontal form with data from a database, they then can click a button to go into edit mode to edit and save this data.

I could do this manually or is it a good way to do it with a datagrid and custom templates, and bind it to a datasource with a single record?

What do you think?
Shinu
Top achievements
Rank 2
 answered on 05 Jul 2008
1 answer
163 views
I have a datagrid . In two colums of it, I have a  label in ItemTemplate Tag, and a dropdownlist in EditItemTemplate tag. Editing is enabled in the grid.

Is it possible for me to check different rows of the grid at a time and open all the checked rows in edit mode at the same time?

Now what I do is to store the row index of all checked rows in an array and loop through that array to get the edit index for the grid, but it doesnt work.

Can someone help me with this?
Shinu
Top achievements
Rank 2
 answered on 05 Jul 2008
1 answer
180 views

When a user selects a row on my grid and clicks the button, it is meant to update the value of one of the columns by inserting a string to the database based on the selection.

However, the button causes a postback so the state of the grid's selected row value is lost.

My parameter comes back with an out of bounds error despite the grid looking checked on the running form:

ClientId.Value = grdClient.SelectedItems(0).OwnerTableView.DataKeyValues(grdClient.SelectedItems(0).ItemIndex)("iClientId")

How can I preserve the selected state of the grid so the client id selected value can be passed to the parameter after the button's postback? 

Shinu
Top achievements
Rank 2
 answered on 05 Jul 2008
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?