Telerik Forums
UI for ASP.NET AJAX Forum
6 answers
1.0K+ views

Hi, I’m a bit stuck. I am using the below to add a custom group by expression to a rad grid. I want the user to be able to group by any of the other fields in the grid, but always have my custom sort last (I have used e.canceled to stop them deleting it and was going to look at removing the group by box from the group by bar as well).

I have tried changing the index of the item, removing the item, then inserting it, but even this doesn’t seem to work. I have tried adding it back intot he collection on prerender, but even this adds it before the new expression.

I’m sure it’s simple, but I can’t see how to do it. All i want is for the user to be able to group as they want, and then add this last grouping after any other group by expressions that they might have added.

 

 

 

Dim thestring As String
thestring = "nominal_id [Nominal ID], first_name [First name],middle_name [Middle name],last_name [Surname],nicknames [Nicknames],dob [DOB],place_of_birth [Place Of Birth],miss_count [Files], photograph [photo] Group By nominal_id"
Dim expression1 As GridGroupByExpression = GridGroupByExpression.Parse(thestring)

 

 

Me.RadGrid1.MasterTableView.GroupByExpressions.Add(expression1)

 

 

 

James
Top achievements
Rank 1
 answered on 25 Oct 2011
3 answers
50 views
Whenever the scheduler is clicked on to add/edit an appointment, it causes the calendar to display incorectly.
I have attempted to hack the css:

.RadCalendar .rcRow td
{
   border-top-width: 0px!important;
   border-right-width: 0px!important;
   border-bottom-width: 0px!important;
   border-left-width: 0px!important;
 
}

But this has an equally bizarre effect.
Peter
Telerik team
 answered on 25 Oct 2011
23 answers
2.1K+ views
Hi, I have a dynamically generated Radgrid (server-side defined columns and data) which has a nested view template which, inside, has another dynamically generated Radgrid.  I merely defined the nested radgrid object in the aspx and the rest of the properties, including data, columns, etc. are generated server-side using the PreRender method of the parent RadGrid.  It all works beautiful until I try to add, edit or delete a record inside the nested (child) RadGrid. When that is done, the nested grid dissapears :(.  I tried doing the same thing traversing through all the items of the grid in the Page PreRender method and initializing the nested RadGrid inside the child items of such items, when I do that and try to edit or add a record in the nested RadGrid, the grid does not dissapears but stays as if I had not pressed any buttons.

What would be the proper or recommended way to do this? Will it be too slow if I do it in the PageLoad since the nested Radgrid will all be generated and databinded every time I access the page or do a postback??

I am out of ideas here, help would be greatly appreciated.
-Manuel
Sebastian
Telerik team
 answered on 25 Oct 2011
1 answer
42 views

We have a series of management forms that utilize the RadGrid RadControl for Asp.Net Ajax (2010, 3, 1317, 35) and are bound to objects of type List (of T). The issue we are facing is that sorting and filtering, utilizing the grids header sorting/filtering features on fields that are foreign keys to other objects of type List (of T), don’t sort/filter by its textual value. Rather, it filters on the ID as it is the data originally bound to the grid and the only value stored in the data bound List (of T). It can be assumed that each List (of T) object directly correlates to a table. What we are looking for is a reasonable solution given the following constraints:

  • The main object of type List (of T) cannot be altered to include other properties.

      My hope is that there is a solution to bind on the original object of type List (of T), and sort/filter in some custom fashion (within the constraints of the grid) utilizing the foreign property link between its parent object of type List (of T). I have included an image below of what I am attempting to do as attachment.


Thanks.
Venky Adabala

Sebastian
Telerik team
 answered on 25 Oct 2011
3 answers
305 views
I have RadGrid that uses NeedDataSource and it works fine. What I can't figure out in how to do an automatic insert, since the examples I could find do it in the DataSource definition in aspx code.

Can someone point me to an example  or a tutorial, please?
Shinu
Top achievements
Rank 2
 answered on 25 Oct 2011
1 answer
74 views
Hi there

Can anybody advise about a rather cosmetic problem I have with a radEditor that is set to be a particular height, but which makes a bit of a mess of the page the first time it is rendered. I currently have it hidden within a div, that I show last, in a bid to tidy up the display, but it doesn't seem to make much difference. What happens is that the radEditor seems to make a slight delay while it adjusts the height down to the height configured in the markup, but in the meantime the subsequent Javascript has been continuing, showing other nearby controls beneath the radEditor. They are in the correct place, but of course the radEditor is using the incorrect height for a second or so, during which the radEditor document and the other controls are scrambling about trying to occupy the same space in the window. 

This is what I have been experimenting with so far, but it doesn't seem to matter which order I set divs or other controls to show or hide, the radEditor resize always is the last thing to get completed:

Javascript segment:
------------------------ 

// I get a reference to the div containing the radEditor further up here, calling it 'editdiv'
// and a reference to the div underneath 'editdiv', containing the other controls, calling it 'maskdiv'

// Display the previously hidden radEditor
// Get reference to radEditor input document, and make sure it is hidden
var mycmnteditor = $find("ctl00_ContentPlaceHolder1_radCommentEditor2");
var oDocument = mycmnteditor.get_document();
oDocument.className = 'hide';

// Reveal the div that contains the radEditor
$(editdiv).removeClass().addClass("show");

// Control display of controls in the div underneath radEditor by showing their div
maskdiv.className = 'show';

// Finally, reveal the radEditor document, but even at this stage it is still the wrong height for a short time
oDocument.className = 'show'; 

------------------------------------------

All this Javascript works, it's just that there is the timing problem, with the radEditor height taking too long to be rendered. Is there any way to pause the rendering of other controls until the radEditor is at the right height, so that the page appearance loads more smoothly? I can't see any other client-side events in the documentation that would appear to be relevant, I already tried 'onclientload=', and it didn't seem to make any difference when I tried using it.

Thanks if you can help
 



Rumen
Telerik team
 answered on 25 Oct 2011
3 answers
183 views
Hi,

I have a telerik 35 version and a rad file explorer with following configurations in code behind:

oCmsBusiness =

 

new cmsBusiness();

 

fileExplorerFiles.Configuration.ContentProviderTypeName =

 

typeof(DBContentProvider).AssemblyQualifiedName;

 

olistCmsFolder = oCmsBusiness.ReadAllRootFolders();

 

 

var query = from entity in olistCmsFolder select entity.FolderName;

 

fileExplorerFiles.Configuration.ViewPaths = query.ToArray();

fileExplorerFiles.Configuration.UploadPaths = query.ToArray();

fileExplorerFiles.Configuration.DeletePaths = query.ToArray();

I am also set

 

fileExplorerFiles.EnableCreateNewFolder =

 

true;

 

My problem is during run time the Add folder icon is not showing in radfile tool bar and in context menu.In design time its showing.
Please help.

Regards,
Praveen.

Dobromir
Telerik team
 answered on 25 Oct 2011
1 answer
76 views
Hai,

I want to create a report in the following format. Here not all bars start from X axis. Bars B and C are not started from X axis. Is there any telerik chart which suits its requirements?

Thanks,
Regeesh Joseph

Evgenia
Telerik team
 answered on 25 Oct 2011
3 answers
177 views
how do i bind the dropdownlist in insert or edit mode and then how the Update or Insert command will find the control...
i tried a lot didnt worked

here is the code

protected void RadGrid1_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
     {
         SqlDataAdapter da = new SqlDataAdapter("select c.City, s.State from MST_State as s inner join MST_City as c on c.StateID = s.ID ", con);
         DataTable mydatatable = new DataTable();
         da.Fill(mydatatable);
 
         RadGrid1.DataSource = mydatatable.DefaultView;
 
     }
     //protected void RadGrid1_InsertCommand(object sender, GridCommandEventArgs e)
     //{
     //   
     //}
         protected void RadGrid1_InsertCommand(object source, GridCommandEventArgs e)
     {
        //GridEditableItem editedItem = e.Item as GridEditableItem;
        //UserControl userControl = (UserControl)e.Item.FindControl(GridEditFormItem.EditFormUserControlID);
        GridEditFormInsertItem inserteditem = (GridEditFormInsertItem)e.Item;
        //Create new row in the DataSource
        
 
        //Insert new values
 
         string City = (inserteditem["City"].Controls[0] as TextBox).Text;
 
 
         DropDownList list = (inserteditem.FindControl("State") as DropDownList);
         string State = list.SelectedValue;
 
 
 
 
 
         con.Open();
         string insertquery = String.Format("insert into MST_City values('{0}',  '{1}')", City, State);
 
         SqlCommand sql = new SqlCommand();
         sql.CommandText = insertquery;
         sql.Connection = con;
         sql.ExecuteNonQuery();
         con.Close();
 
     }

and i want when i click add new record the state should be binded in dropdownlist...
Princy
Top achievements
Rank 2
 answered on 25 Oct 2011
1 answer
85 views
I'm trying to do something similar to the example here: http://www.telerik.com/help/aspnet-ajax/menu-with-radconfirm.html

It mostly works, however some menu items are navigate links to other pages in my application, and the NavigateUrl is something like "~/folder/page.aspx". Obviously this doesn't work. Is there any easy way (client-side) to get the value translated to an absolute URL, or do I have to change the code to put the absolute URL in the NavigateURL?

Thanks

ROSCO

Princy
Top achievements
Rank 2
 answered on 25 Oct 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?