Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
97 views
In 2007 Q2 release I detect the toggled buttons using something like myButtonToolbar.Items.ToggleButtons and if I want to know how many toggled buttons I have I typed myButtonToolbar.Items.ToggleButtons.Count and I have this information.

It's possible doing something like this in 2008 Q3 release? I think it's ugly to do a foreach for each item of the toolbar to detect if it's a toggle button or not and count them.
Jesús
Top achievements
Rank 1
 answered on 11 Dec 2008
1 answer
255 views
MY REQUIREMENT IS I WANT TO DISPLAY HOURS AND NOT THE DATE IN EACH TIME SLOT OF THE TIMELINE.
I am in TimeLineview of RadScheduler. Following are the properties of the timeline view:-

<

TimelineView NumberOfSlots="8" SlotDuration="01:00" />

 


when I set HeaderDateFormat="hh:mm" it changes the format of the date in header. MY REQUIREMENT IS I WANT TO DISPLAY HOURS AND NOT THE DATE IN EACH TIME SLOT OF THE TIMELINE. Presently, it shows the current date in every time slot and not the individual time. Please help.
Peter
Telerik team
 answered on 11 Dec 2008
2 answers
327 views
I'm trying to insert a new row every time on button click function. I'm able to insert a row, but it overwrites on top of the previous row instead of creating a new row. Am I missing something?Here is my code.

void FillGrid()
{
DataTable DT=new DataTable();        
DT.Columns.Add("Name", typeof(string));
DT.Columns.Add("Header", typeof(string));
if (Name.Text.Length > 0)
         {           
             sName = QuestionText.Content;
         }
         if (Header.Text.Length > 0)
         {         
             sHeader = Header.Text;
         }
 DT.Rows.Add(sName, sHeader);
}
public void Nrow()
     {
         DT.Rows.InsertAt(DT.NewRow(),0);
     }
     public void BindDG()
     {
       
         QuestionsGrid.DataSource = DT;
         QuestionsGrid.DataBind();      
     }
 protected void Step2AddMore_Click(object sender, EventArgs e)
     {
         try
         {
             QuestionsGrid.CurrentPageIndex = 0;
             FillGrid();
             Nrow();
             BindDG();
             
         }
         catch (Exception ex)
         {
             ErrorMessage.Text = ex.ToString();
             ErrorMessage.Visible = true;
         }
     }  


Jayanthy Kapistalam
Top achievements
Rank 1
 answered on 11 Dec 2008
1 answer
112 views
I have  page set up with a radsplitter and three panes. This is to edit packages. There is a package_id as the key to the packages table.

There is a left vertical pane that has a grid with one column. I have a pane on the right that has a grid. When the user selects a row on the left pane, I have client code to get the package_id, puts that number in a textbox, and then the grid on the right uses the textbox as a parameter to a select command to get data from tables to populate the grid on the right which will have package info.
Once the user clicks on the selected row, I have the client javascript put the package_id in the textbox and then call server code using ajaxrequest to rebind the grid with the proper package info. In my debugger, the textbox has the current selected package_id, but the grid does not rebind. What I am doing wrong? Here is my code:

<html xmlns="http://www.w3.org/1999/xhtml" > 
<head runat="server"
    <title>Packages</title> 
    <style type="text/css"
       
      html, body, form 
     { 
       height: 100%; 
       margin: 0px; 
       padding: 0px; 
     }  
    </style> 
    
</head> 
<body> 
    <form id="form1" runat="server"
    <div> 
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server"
        </telerik:RadScriptManager> 
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"  
            onajaxrequest="RadAjaxManager1_AjaxRequest"  
            DefaultLoadingPanelID="RadAjaxLoadingPanel1"
            <AjaxSettings> 
                <telerik:AjaxSetting AjaxControlID="packageID"
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="buildPackageGrid" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
                <telerik:AjaxSetting AjaxControlID="mainSplitter"
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="mainSplitter" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
            </AjaxSettings> 
        </telerik:RadAjaxManager> 
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Height="75px" Width="75px" Transparency="10"
        <img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>' 
            style="border: 0px;" /> 
        </telerik:RadAjaxLoadingPanel> 
   
        
        <telerik:RadSplitter ID"mainSplitter" runat="server" Orientation="Vertical"  ResizeMode="AdjacentPane" width="100%"  
                VisibleDuringInit="false" Height="100%" ResizeWithParentPane="true"
         <telerik:RadPane id="leftPane" runat="server"    width="22"   minwidth="22" Scrolling="none"
           <telerik:RadSlidingZone id="SlidingZone1" runat="server"   clicktoopen="true"  DockedPaneId="sPackages" ExpandedPaneId="sPackages" > 
            <telerik:RadSlidingPane id="sPackages" title="Packages" runat="server" width="215"   Scrolling="Both" EnableResize="false" > 
              <telerik:RadGrid ID="packageGrid" runat="server"  Width="200px"  
                    DataSourceID="SqlDataSourcePackages" AutoGenerateColumns="False"  
                    GridLines="None" > 
              <ClientSettings> 
                <Selecting AllowRowSelect="true"  EnableDragToSelectRows="true" /> 
                <ClientEvents  OnRowSelected="rowSelected" /> 
              </ClientSettings> 
                   
                  <MasterTableView> 
                      <Columns> 
                          <telerik:GridBoundColumn DataField="package_id" UniqueName="package_id" Display="false"
                          </telerik:GridBoundColumn> 
                          <telerik:GridBoundColumn DataField="package_name" UniqueName="package_name" HeaderText="Package name" > 
                            
                          </telerik:GridBoundColumn> 
                      </Columns> 
                  </MasterTableView> 
                  <FilterMenu EnableTheming="True"
                      <CollapseAnimation Duration="200" Type="OutQuint" /> 
                  </FilterMenu> 
              </telerik:RadGrid> 
            </telerik:RadSlidingPane> 
           </telerik:RadSlidingZone> 
          </telerik:RadPane> 
          <telerik:RadSplitBar id="Radsplitbar3" runat="server" collapsemode="Forward"   /> 
          <telerik:RadPane id="contentPane" runat="server"  Scrolling="Both"    >   
           <telerik:RadSplitter ID"embeddedSplitter" runat="server" Orientation="Horizontal" ResizeMode="EndPane" width="100%"  
                VisibleDuringInit="false" Height="100%" ResizeWithParentPane="true"
              <telerik:RadPane ID="topPane" runat="server" ContentUrl="contentviewer.aspx?price=Y"
                 
              </telerik:RadPane> 
              <telerik:RadSplitBar id="Radsplitbar2" runat="server" collapsemode="Both"   /> 
              <telerik:RadPane ID="bottomPane" runat="server" > 
                <telerik:RadGrid ID="buildPackageGrid" runat="server"  DataSourceID="SqlDataSourceselectPackage" > 
                  <MasterTableView  runat="server" AutoGenerateColumns="False"
                     <GroupByExpressions> 
                      <telerik:GridGroupByExpression> 
                       <GroupByFields> 
                         <telerik:GridGroupByField FieldName="mid_type_name" SortOrder="Descending"></telerik:GridGroupByField> 
                       </GroupByFields> 
                       <SelectFields> 
                        <telerik:GridGroupByField FieldAlias="mid_type_name" FieldName="mid_type_name" HeaderText="Mid type" /> 
                       </SelectFields> 
                      </telerik:GridGroupByExpression> 
                     </GroupByExpressions> 
                   <Columns> 
                   <telerik:GridBoundColumn UniqueName="mid_name" DataField="mid_name" HeaderText="Package Contents" ></telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn UniqueName="package_name" DataField="package_name" HeaderText="Package Name" SortExpression="package_name"></telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn UniqueName="mid_type_name" DataField="mid_type_name" HeaderText="Mid type" SortExpression="mid_type_name"></telerik:GridBoundColumn> 
                     
                   </Columns> 
                  </MasterTableView> 
                </telerik:RadGrid> 
              </telerik:RadPane> 
           </telerik:RadSplitter> 
          </telerik:RadPane> 
             
            
         </telerik:RadSplitter> 
         <asp:TextBox ID="packageID" runat="server" Visible="true" Width="0" Height="0" 
             style="border: 0px solid #b0c4de;background-color:#b0c4de;"></asp:TextBox> 
        
        <asp:SqlDataSource ID="SqlDataSourcePackages" runat="server"  
            ConnectionString="<%$ ConnectionStrings:CC2ConnectionString2 %>"  
            SelectCommand="SELECT [package_id], [package_name], [package_cd], [mid_id] FROM [PACKAGES]"></asp:SqlDataSource>     
        <asp:SqlDataSource ID="SqlDataSourceselectPackage" runat="server"  
            ConnectionString="<%$ ConnectionStrings:CC2ConnectionString2 %>"  
             
            SelectCommand="SELECT DISTINCT PACKAGES.package_id, PACKAGES.package_name, PACKAGES.descriptions, MODULE_IDS.mid_id, MODULE_IDS.mid_type_id, MODULE_IDS.mid_name, PACKAGES.package_cd, PACKAGES.pkg_type, MID_TYPES.mid_type_name FROM MID_TYPES INNER JOIN MODULE_IDS ON MID_TYPES.mid_type_id = MODULE_IDS.mid_type_id INNER JOIN PACKAGE_MIDS ON MODULE_IDS.mid_id = PACKAGE_MIDS.mid_id INNER JOIN PACKAGES ON PACKAGE_MIDS.package_id = PACKAGES.package_id WHERE (PACKAGES.package_id = @packageID)"
            <SelectParameters> 
                <asp:ControlParameter ControlID="packageID" Name="packageID"  
                    PropertyName="Text" DefaultValue="501" /> 
            </SelectParameters> 
        </asp:SqlDataSource> 


namespace ContentCentral 
    public partial class Packages : System.Web.UI.Page 
    { 
        protected void Page_Load(object sender, EventArgs e) 
        { 
 
        } 
        protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e) 
        { 
 
            string sPackageID = packageID.Text; 
            buildPackageGrid.Rebind(); 
        } 
    } 
      
 

Laura
Top achievements
Rank 1
 answered on 11 Dec 2008
1 answer
404 views
Hello,
    I have a hierarchial radgrid where the details tables have the option of Add/Edit & delete records. This is implemented using the automatic data source operations. In add/edit mode, one field is shown using the RadCombo box with 500+ records. All the required functionality is working fine but the overall performance of the grid is slow.

To improve the performance of the grid, I am in the process of modifying the RadCombo box to EnableLoadOnDemand. The LoadOnDemand functionality is working fine but I am having issues with the Add & edit operations. Below is the code extract for the same:

<

EditItemTemplate>

 

<

telerik:RadComboBox ID="RadComboBoxEmps"

 

 

runat="Server" MarkFirstMatch="True" AppendDataBoundItems="True" EnableLoadOnDemand="True" OnItemsRequested="RadComboBoxEmps_ItemsRequested" OnClientItemsRequesting="OnClientItemsRequesting">

 

 

</telerik:RadComboBox>

 

</

EditItemTemplate>

 


In the RadComboBoxEmps_ItemsRequested event, I have added the code to populate this Radcombo box using a datareader.
But When I attempt to Add a new record or update existsing record, the SP responsible for insert/ Update throws a error saying that value for one of the field is NULL. And that field is refering to the value of the above RadCombo. i.e. for some reason the Value of  selected item of the radcombo box is sent as null to the Insert SP. And I am sure that none of the Value in the RadCombo box is Null as it is populated from a master table.

I have following questions with this regards:

1. Will Radcombo box with  EnableLoadOnDemand=true work with automatic data source operations for Add/edit & delete? I  have seen some samples for EnableLoadOnDemand but I couldn't find any sample for it with automatic data source.

2. How will the automatic data source operations know that the above Radcombo box is mapped to some field in InsertParameters & UpdateParameters of SQLDatasource?

3. Do I have to write some code in the Itemdatabound event for the edit operations?

Please help me fix this issue.

Thanks,
Rajiv
Nikita Gourme
Top achievements
Rank 1
 answered on 11 Dec 2008
0 answers
40 views
I am in resourceview. How do I display my resources grouped by timezones in a single scheduler and display the corresponding timezone as well?
Indranik
Top achievements
Rank 1
 asked on 11 Dec 2008
1 answer
169 views
Hello everyone,

Right now I need to add a GridDropDownColumn at runtime, not design time, and the dropdowmitem's data come from a Dictionary, the key is the item's value, the value is the item's text. How can I do it?

Part of my code looks like :

        Dictionary<stringstring> dicValues = DropdownListData as Dictionary<stringstring>;  
        if (dicValues != null)  
        {  
            GridDropDownListColumnEditor editor = gridColumn.ColumnEditor as GridDropDownListColumnEditor;  
            foreach (KeyValuePair<stringstring> value in dicValues)  
            {  
                editor.DropDownListControl.Items.Add(new ListItem(value.Value, value.Key));  
            }  
        } 

But I got nothing, when I switch to the edit model, the dropdownlist has no items. Any one know how to do this?

Thanks and Best regards,

Bryan.
Sebastian
Telerik team
 answered on 11 Dec 2008
2 answers
327 views
Hi,

I am using the radGrid for a print preview page. Here I am using the Grid in a table in the page and the width of the Grid is a Percentage (%) of the Table/Page. This works perfectly by resizing the grid width as I resize the page.
So, it works for different screen resolutions also.

Also in the grid I am using the following option:

<

PagerStyle Mode ="NextPrevNumericAndAdvanced" AlwaysVisible="true" />

 


Now, as far as the height of the grid is concerned, when I put Pixels (px),then it works by adjusting the height statically. (Of course this messes the grid view in lower/higher resolutions).
But, when I put the height of the grid as Percentage (%) of the Table/Page, this completely collapses the grid and I cannot see anything on the Grid.

My aim is to display the data in the Grid completely on the "Print Preview" page when I resize the page.

Another option would be to allow viewing of data in grid by scrolling and allow me to print all the Grid data.
But, in the following post, it is mentioned that direct printing of the data in grid is not supported:

http://www.telerik.com/community/forums/aspnet-ajax/grid/print-grid-data.aspx

But I know that there is possibly a way to use some other function to print all the data in the grid or at least adjust the height of the grid so that the display of the Print preview page is better (which can then be printed by page print).

Thank you.
~schaturvedi
Shantnu Chaturvedi
Top achievements
Rank 1
 answered on 11 Dec 2008
1 answer
101 views
Hi,

I have a
<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
 
<%@ Register src="WebUserControl.ascx" tagname="WebUserControl" tagprefix="uc1" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        </telerik:RadScriptManager>
        <telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True"  
            AllowSorting="True" GridLines="None"  
            onneeddatasource="RadGrid1_NeedDataSource" AllowAutomaticDeletes="True"  
            AllowAutomaticInserts="True" AllowAutomaticUpdates="True"  
            AutoGenerateDeleteColumn="True" AutoGenerateEditColumn="True">
<HeaderContextMenu EnableTheming="True">
<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
</HeaderContextMenu>
 
<MasterTableView>
<RowIndicatorColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>
 
<ExpandCollapseColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
<Columns>
<telerik:GridTemplateColumn HeaderText="someheader">
<ItemTemplate>
some user control
</ItemTemplate>
<EditItemTemplate>
<uc1:WebUserControl ID="WebUserControl1" runat="server" />
</EditItemTemplate>
</telerik:GridTemplateColumn>
</Columns>
</MasterTableView>
 
            <ClientSettings>
                <Scrolling AllowScroll="True" UseStaticHeaders="True" />
            </ClientSettings>
 
<FilterMenu EnableTheming="True">
<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
</FilterMenu>
        </telerik:RadGrid>
    </div>
     
    </form>
</body>
</html>


And the usercontrol:



<%@ Control Language="C#" AutoEventWireup="true" CodeFile="WebUserControl.ascx.cs" Inherits="WebUserControl" %>
<asp:ListBox ID="ListBox1"  SelectionMode="Multiple" runat="server">
    <asp:ListItem>12</asp:ListItem>
    <asp:ListItem>3</asp:ListItem>
    <asp:ListItem>45</asp:ListItem>
    <asp:ListItem>5</asp:ListItem>
    <asp:ListItem>5</asp:ListItem>
    <asp:ListItem>44</asp:ListItem>
    <asp:ListItem>3434</asp:ListItem>
</asp:ListBox>
 

how do i get the values from the listbox in the usercontrol when performing a save or update? and how do i select pre-defined values(the ones saved in an edit to a db) in the listbox when displaying it in itemtemplate?


 
Sebastian
Telerik team
 answered on 11 Dec 2008
3 answers
183 views
In the documantation for the RadWindow radprompt, there is indication of the ability to pass additional data to the callback function:

callerObj
- provides ability to "pass" a reference to  a HTML object, such as button to the callback function.

All of the examples I can find pass null and do not use this object. Can someone provide an example of how to retrieve this additional data from the callback? When I break inside the function, all I can see is the first argument - text only - text entered into the prompt dialog.

Thanks!
John
Georgi Tunev
Telerik team
 answered on 11 Dec 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?