Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
141 views
Hi
Is there a way to print the radgrid (ie to export and send it to printer) without opening in pdf/tiff files?

Appreciate your support.
Regards,
SR





Mohammed
Top achievements
Rank 1
 answered on 03 Aug 2011
1 answer
86 views
Team Telerik,

I've created a grid programatically and populate it with data.  The first two columns are frozen, and I'm able to scroll left and right with the horizontal scroll bar.  Everything looks wonderful.  However, when I click on any column header to sort the data (Frozen, or Data columns); the horizontal scroll bar disappears and the columns off screen become inaccessible.   Let me know if I've done anything wrong, below you will find my code.  When I remove FrozenColumnsCount from the code, everything works fine.  However... I do need the first two columns to be frozen.

Thanks,
Michael

protected void Page_Init(object source, System.EventArgs e)
{
    DefineGridStructure();
}
 
private void DefineGridStructure()
{
    var someTable = GetSomeTable();
 
    RadGrid radGrid1 = new RadGrid();
     
    radGrid1.ItemCommand += new GridCommandEventHandler(radGrid1_ItemCommand);
 
    radGrid1.PagerStyle.Mode = GridPagerMode.NextPrevAndNumeric;
    radGrid1.AutoGenerateColumns = false;
    radGrid1.ShowStatusBar = true;
    radGrid1.MasterTableView.DataKeyNames = new string[] { "Id" };
    radGrid1.DataSourceID = "ObjectDataSource1";
    radGrid1.AllowSorting = true;
    radGrid1.AllowPaging = true;
    radGrid1.PageSize = 50;
    radGrid1.Width = new Unit(99, UnitType.Percentage);
 
    radGrid1.MasterTableView.TableLayout = GridTableLayout.Fixed;
    radGrid1.ClientSettings.Scrolling.AllowScroll = true;
    radGrid1.ClientSettings.Scrolling.UseStaticHeaders = true;
    radGrid1.ClientSettings.Scrolling.FrozenColumnsCount = 2;
    radGrid1.ClientSettings.Scrolling.SaveScrollPosition = true;
     
 
    GridBoundColumn displayFrozenColumn = new GridBoundColumn();           
    displayFrozenColumn .DataField = "Name";
    displayFrozenColumn .HeaderText = "Name";
    displayFrozenColumn .HeaderStyle.Width = new Unit(200, UnitType.Pixel);
    displayFrozenColumn .ItemStyle.Font.Bold = true;                   
    radGrid1.MasterTableView.Columns.Add(displayFrozenColumn );
 
    displayFrozenColumn = new GridBoundColumn();               
    displayFrozenColumn .DataField = "Id";
    displayFrozenColumn .HeaderText = "Id";
    displayFrozenColumn .HeaderStyle.Width = new Unit(50, UnitType.Pixel);
    displayFrozenColumn .ItemStyle.Font.Bold = true;           
    radGrid1.MasterTableView.Columns.Add(displayFrozenColumn );
 
    foreach (DataColumn dataColumn in someTable.Columns)
    {
        if (dataColumn.ColumnName == "Name" || dataColumn.ColumnName == "Id")
            continue;
 
        GridButtonColumnWithFilteringSorting displayDataColumn = new GridButtonColumnWithFilteringSorting();               
        displayDataColumn .HeaderText = dataColumn.ColumnName;
        displayDataColumn .DataTextField = dataColumn.ColumnName;
        displayDataColumn .SortExpression = dataColumn.ColumnName;
        displayDataColumn .UniqueName = dataColumn.ColumnName;
        displayDataColumn .HeaderStyle.Width = new Unit(75, UnitType.Pixel);              
 
        radGrid1.MasterTableView.Columns.Add(displayDataColumn );
    }
     
 
    PlaceHolder placeHolder1 = (PlaceHolder)RadPanelBar1.FindItemByValue("PanelItem1").FindControl("PlaceHolder1");
    placeHolder1.Controls.Add( radGrid1 );
}
Pavlina
Telerik team
 answered on 03 Aug 2011
1 answer
77 views
I have a RadPanelBar that is databound.  Based on the values contained in the datasource, certain controls will be added to each child item.  Controls such as dropdown, listbox, multiple labels, textboxes and buttons are added.  On clicking a button or dropdown selectedindexchanged the controls disappear.  I have tried creating dynamic controls in PanelBar_prerender event and they are created appropriately and displayed on the initial page_load,

On the subsequent pages, unless I do a PanelBar.DataBind, I get weird situation where the first child item disappears and the last child item repeats.  On the next postback what was now the first child item will disappear and the last child item will now appear three times.

I have seen the example where panelitems are created in the page_load event.  However, what I have is a databound PanelBar.  I have seen references to "templateneeded" event, but none of the links seem to work to get to that article.

Can you provide an example of where controls are added dynamically to child panelitem when the PanelBar itself is databound and the dynamically created controls need to postback.

Thanks
Sumith
Kate
Telerik team
 answered on 03 Aug 2011
2 answers
131 views
I have 2 List Boxes. One with State the other with City. The City Listbox has Checkboxes. 
I am trying to find a way to have all the checkboxes 'checked' as the default when the page opens with a State Default selected.
For example ... When the page opens the State Selected Value is 'WA' and all the cities in Washington are displayed with checkboxes. Works fine.
But I want them displayed with Checkboxes 'Checked'

I have tried the collection method:
If Not Page.IsPostBack Then
    rlbAreas.SelectedValue = "F50"
    Dim collection As IList(Of RadListBoxItem) = rlbSubAreas.Items
    For Each item As RadListBoxItem In Collection
       item.Checked = True
   
Next End If

But the collection at this point returns 0 items. I tried rebinding the rlbSubAreas listbox but that didn't work either.

Anyone?
Thad
Top achievements
Rank 2
 answered on 03 Aug 2011
1 answer
186 views
I am trying to display the items inserted into the destination listbox when multiple items are selected from the source but the items inserted is only the ones that are not duplicates since allow dupliates is set to false.  Below is my code.  However,  I am getting the items selected.  How do I get only the items that were actully inserted since it is not adding the duplicates.

Protected

Sub rlDestinationGroup_Inserted(sender As Object, e As Telerik.Web.UI.RadListBoxEventArgs) Handles rlDestinationGroup.Inserted

  'gets the selected employee name

  Dim empName As String = rdCBEmpList.SelectedItem.Text

   lblMsg.Text = empName & " was added to the following group(s): "

 ' returns the list of items selected from the Source List

  For Each item As RadListBoxItem In rlGroupListSource.SelectedItems

 lblMsg.Visible = True

 lblMsg.Text += item.Text & ", "

 Next

 End Sub

Your assistance is appreciated.

 

Genady Sergeev
Telerik team
 answered on 03 Aug 2011
1 answer
41 views
Hai,

I have created a scheduler and Grid in which the grid drop is enabled.
When the Item is created on the drop of the grid the Appointments are not possible to "Resize or Repostion by Dragging".

Only these actions are permitted only if I do a page refresh or the postback.

What could be the reason.

Any help.


Vinu
Peter
Telerik team
 answered on 03 Aug 2011
1 answer
44 views

Hello every one,

How to bind empty row and columns in ragrid ,
It's possible ,
After The i fill in that radgrid


Regards,
Mohamed.
Princy
Top achievements
Rank 2
 answered on 03 Aug 2011
1 answer
275 views
Hello

I want to place a count down timer by using JavaScript in my tool tip, which is a .ascx.
In normal pages, the script works and the timer shows. But when showing in a tool tip, it doesn't work.

Is it an abnormal behavior?

Looking forward for the answer.

Thanks in advance
Thanh Dang



Svetlina Anati
Telerik team
 answered on 03 Aug 2011
1 answer
75 views
I've got a RadGrid with detail tables in a search application.

Often times my users are looking at the detail tables and then change the search critieria.

At that point my code rebinds the grid and the detail tables the users were looking at before and no longer expanded. The users are not excited about having to expand out the detail tables again.

What's the best way to handle this situation. Is there an easy way to get the rows that are expanded before the bind and then programmatically expand them again?

--Mark 
Tsvetina
Telerik team
 answered on 03 Aug 2011
1 answer
52 views
When hovering over a root item it appears that the child item all move up 1 pixel.  Can anyone tell me what are the CSS classes that are causing this?
Kate
Telerik team
 answered on 03 Aug 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?