Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
68 views
  1. Grid is defined in markup
  2. But the grid columns are added dynamically after the data is fetched from database onNeedDataSource
  3. I had to set the EnableViewState to false since the grid columns are created dynamically
  4. When a different page in the grid is selected, Grid.PageIndex is always returning 0 even when the paging is enabled. Why?
  5. To solve the above issue, I tried to add OnPageIndexChanged event to the grid. But this event is never getting called when a different page is selected in grid. Why? Does this not work when ViewState is disabled?
Can you please explain how to make the PageIndex to return the appropriate page selected?
Andrey
Telerik team
 answered on 15 Jul 2013
1 answer
111 views
Hello, im using sqldatasource to select the datas and configure to the schedular. However, the schedular did not show any datas.
Below are my codes and i've attach my table image:
deafult.aspx
<asp:SqlDataSource ID="SqlDataSourceSchedule" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
        
        SelectCommand="SELECT classDetailsID,cd.classID,classType,startDate,endDate,batch,leftSlot FROM ClassDetail cd INNER JOIN Class c ON cd.classID=c.classID WHERE locationID=1 AND batch=2">
    </asp:SqlDataSource>
    
    <br/><br/><br/><br/><br/>
    <telerik:RadScheduler ID="RadScheduler1" runat="server"
            SelectedView="MonthView" DataEndField="endDate" DataKeyField="classDetailsID" 
        DataSourceID="SqlDataSourceSchedule" DataStartField="startDate" 
        DataSubjectField="classType" Height="" SelectedDate="2013-07-15" 
        EditFormDateFormat="d/M/yyyy" EditFormTimeFormat="h:mm tt" 
        EnableCustomAttributeEditing="True">
         <AdvancedForm Modal="True" EnableCustomAttributeEditing="True"></AdvancedForm>                
                 <AppointmentTemplate>
                    <div class="rsAptSubject">
                        <asp:Label ID="Label2" runat="server" Text="Label"></asp:Label>
                         <%# Eval("classType") %>
                    </div>
                  
               </AppointmentTemplate>
             <TimeSlotContextMenuSettings EnableDefault="True"></TimeSlotContextMenuSettings>
            <AppointmentContextMenuSettings EnableDefault="True"></AppointmentContextMenuSettings>
    </telerik:RadScheduler>
Shinu
Top achievements
Rank 2
 answered on 15 Jul 2013
1 answer
237 views
I have auto generated columns in my radgrid and i'm trying to enable column filtering on enter key press. when i type search text and press enter i'm getting the following error.
Uncaught TypeError: Cannot read property 'value' of null
<telerik:RadGrid ID="gridSearchL3" runat="server" AllowPagg="True" 
             GridLines="None" Height="415px" 
             OnNeedDataSource="RadGrid1_NeedDataSource"
            Font-Names="Eras Medium ITC" Font-Size="Small" PageSize="50" 
             AllowFilteringByColumn="True"
           
             AllowSorting="True" ShowStatusBar="True" AllowPaging="True" CellSpacing="0" 
                oncolumncreated="gridSearchL3_ColumnCreated1" onitemcommand="gridSearchL3_ItemCommand" 
                >
               <FilterItemStyle Font-Names="Eras Medium ITC" Font-Size="XX-Small" />
               <GroupingSettings CaseSensitive="False" />
            <ExportSettings Excel-Format="ExcelML" ExportOnlyData="True" 
                FileName="PinC Group" IgnorePaging="True" OpenInNewWindow="True">
                <Excel Format="ExcelML" />
            </ExportSettings>
            <ClientSettings>
              
                <Selecting AllowRowSelect="True" />
                <Scrolling AllowScroll="True" UseStaticHeaders="True" />
                    
            </ClientSettings>
            <AlternatingItemStyle Font-Names="Eras Medium ITC" Font-Size="X-Small" />
            <GroupHeaderItemStyle Font-Names="Eras Medium ITC" Font-Size="X-Small" />
            <SortingSettings EnableSkinSortStyles="false" /> 
            <MasterTableView  Font-Names="Eras Medium ITC" 
                   Font-Size="X-Small">
           
                <CommandItemSettings  ExportToPdfText="Export to Pdf" />
                 
                <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
                </RowIndicatorColumn>
                <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
                </ExpandCollapseColumn>
             
                <EditFormSettings>
                    <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                    </EditColumn>
                </EditFormSettings>
                <ItemStyle Font-Names="Eras Medium ITC" Font-Size="X-Small" />
                <PagerStyle Mode="NextPrevNumericAndAdvanced" />
                <FilterItemStyle Font-Names="Eras Medium ITC" Font-Size="X-Small" />
            </MasterTableView>
            <EditItemStyle Font-Names="Eras Medium ITC" Font-Size="X-Small" />
            <FooterStyle Font-Names="Eras Medium ITC" Font-Size="X-Small" />
            <HeaderStyle Font-Names="Eras Medium ITC" Font-Size="X-Small" />
            <FilterItemStyle Font-Names="Eras Medium ITC" Font-Size="X-Small" />
               <CommandItemStyle Font-Names="Eras Medium ITC" Font-Size="X-Small" />
               <ActiveItemStyle Font-Names="Eras Medium ITC" Font-Size="X-Small" />
               <ItemStyle Font-Names="Eras Medium ITC" Font-Size="X-Small" />
               <PagerStyle Font-Names="Eras Medium ITC" Font-Size="X-Small" 
                   HorizontalAlign="Left" Mode="NextPrevNumericAndAdvanced" />
               <SelectedItemStyle Font-Names="Eras Medium ITC" Font-Size="X-Small" />
               <FilterMenu Font-Names="Eras Medium ITC" Font-Size="X-Small" 
                 EnableRoundedCorners="True">
               </FilterMenu>
               <HeaderContextMenu Font-Names="Eras Medium ITC" Font-Size="X-Small" 
                   Skin="Simple">
               </HeaderContextMenu>
               </telerik:RadGrid>

code behind:

public void setSqlDatSource()
    {

        gridSearchL3.DataSource = getsource();

    }


public DataTable getsource()
    {
        string Query;

        Query = @"select distinct h.DocumentNumber 'Document Number' " +
                 " from tblDocumentHeader h    where  h.DocumentHeaderTypeID=3 ";

        SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["PinCBusMgtDocs.Properties.Settings.PINCConnectionString"].ConnectionString);
        DataTable dt = new DataTable();
        using (SqlDataAdapter da = new SqlDataAdapter(Query, con))
        {
            
            da.Fill(dt);
        }

        return dt;
    }


protected void RadGrid1_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
    {

      setSqlDatSource();
  
    }

    protected void gridSearchL3_ColumnCreated1(object sender, GridColumnCreatedEventArgs e)
    {
       if (e.Column.UniqueName == "Document Number")
        {
            e.Column.FilterControlWidth = 120;
            e.Column.HeaderStyle.Width = Unit.Pixel(120);
            e.Column.AutoPostBackOnFilter = true;
            e.Column.CurrentFilterFunction = GridKnownFunction.Contains;
         }
     
        }

             
    }





































































 
Jayesh Goyani
Top achievements
Rank 2
 answered on 15 Jul 2013
2 answers
99 views
Hello,
I have a pie chart in a user control, in an aspx page.  When I view this page all is as it should be.
However, the aspx page is in an iFrame in a multipage and this causes display problems.
When the outer page is loaded or resized each iFrame is resized to the height of the screen ($(window).innerHeight() less an allowances for the tabstrip..
For the HTMLChart the 5 item legend is displayed on one line as per the image attached.
There is also a problem with the display of a grid on the same page.  The grid is set to a height of 250px but when it has more data and needs to scroll it is not contained within the 250px height. Setting the height of this iFrame containing this page to the actual height of the user control (852px)does not fix the problem.
If the user control is in the multipage the display is correct, so it appears to be the iFrame causing the problem.
I need to use iFrames as there may be more dashboards added to the top page in coming months and I think they will blow the page size through the roof. There are already 3 dashboards in the lineup.
Joan
Top achievements
Rank 1
 answered on 15 Jul 2013
1 answer
128 views
I am trying to configure my SQLDatasource for use with a RadGrid.  The RadGrid has a FormTemplate for use in Insert and Updates.  The database is in a SQL Server 2008 R2 server. The data selection process works fine however I am having an issue with the Insert process.  If I configure the datasource for Insert by selecting a stored procedure the setup brings in all of the Insert stored procedure parameters correctly. When I try the Insert process I receive a SQL error "System.Data.SqlClient.SqlException: Procedure or function usp_WorkPackageInsert has too many arguments specified." Even though they match exactly.  Then I tried to change the SQLDatasource to use TEXT and include the stored procedure with the @parameters in the correct order. If I try the insert process I receive an error, "Exception Details: System.Data.SqlClient.SqlException: Error converting data type decimal to decimal".  Then I tried to manually set the parameter default values in the InsertCommand subroutine and get the "too many arguments specified." error.  Then in the InsertCommand subroutine I tried to clear the Insert parameters and re-added them in the same order as they are in the stored procedure but that did not help.  Lastly I decided to try hard coding the insert in the code behind page within the "GRID1_InsertCommand" subroutine using a SQLCommand, SQLConnection, etc and the Insert works.  However, it leaves the Insert window open.

Only other issue I can think of is the data table is within a sub-schema, IE: sales.MyTable instead of dbo.Mytable.  In all cases I have tried to include the schema reference in the Insert command and it did not help.  I know the stored procedure works if I try to execute it in SSMS.

Any suggestions?  Is there a way to close the Insert window if I have to resort to the manual insert using the SQLCommand?

Thanks in Advance,  Jeff
Jeff H.
Top achievements
Rank 1
 answered on 14 Jul 2013
10 answers
629 views
The first time the radwindow opens, all is well...The 2nd time the sizing is all hosed up (looks like a default size ~150x150).

Any ideas?
<telerik:RadWindowManager ID="RadWindowManager1" VisibleStatusbar="false" runat="server" 
        Skin="Web20" Modal="true" DestroyOnClose="true" > 
        <Windows> 
            <telerik:RadWindow runat="server" ID="CoreCodeDialog" Width="600" Height="400" Behaviors="Close" 
                NavigateUrl="CoreProcedure.aspx" ShowContentDuringLoad="false" Title="Select Core Code"
            </telerik:RadWindow> 
            <telerik:RadWindow runat="server" ID="BundleDialog" Width="800" Height="450" Behavior="None"  
                NavigateUrl="ProcedureBundle.aspx" ShowContentDuringLoad="false" Title="Bundle Procedures"
            </telerik:RadWindow> 
        </Windows> 
    </telerik:RadWindowManager> 

ridwaan
Top achievements
Rank 1
 answered on 14 Jul 2013
5 answers
167 views
Hi,  from the demo , Is it possible binding the field with DropDownList?


Thks
From Tan
Shinu
Top achievements
Rank 2
 answered on 14 Jul 2013
1 answer
102 views
Hi,

I have a RadTabStrip and a RadMultipage. When clicking on the Tabs it posts back. On the MultiPage I have a RadNumericInput. 

Problem: When I enter text in the RadNumericInput and immediately click on one of the tabs then the content in the RadNumericInput is lost when I go back to the same tab. However, if I first remove focus from the RadNumericInput (by clicking anywhere on the screen) and then click on the tabs it is working OK.  

It seams like content is not registered in the RadNumericInput when clicking on tabs. (Same problem for other Rad Input Controls).
Shinu
Top achievements
Rank 2
 answered on 14 Jul 2013
1 answer
762 views
Hi,
Because the dropdowntree API is so sparse (I do not really understand why it does not have the same API as the treeview for that part of the control), I am looking at using the treeview in a combobox.  Assuming the following tree structure:

Two levels only

Level 0a
Level 1a
Level 1b
Level 0b
Level 1c
Level1d

I need to be able to click on a Level 0 item and select its child noes, but not the Level 0 node itself.  In other words, after clicking on Level 0a in the above structure, I need to to look like this:

Level 0a - unchecked
Level 1a - checked
Level 1b - checked
Level 0b -unchecked
Level 1c -unchecked 
Level1d - unchecked 

Is there an easy way to do this?  Also, it would be great if I could uncheck the nodes in the other branches as well.
Shinu
Top achievements
Rank 2
 answered on 14 Jul 2013
2 answers
177 views
Hello

I have a scheduler for doctors to set appointments for their patients and the performance is really slow. I found out the issue with my scheduler is the amount of resources I have. I have 4 different resources. (Patient, Physician, Facility, and Appointment Type). The patient record is around 3000 records and it seems to be the culprit here. When I take it out the page size is reduced by half. It takes about 6 seconds to go from one week to another week and without the patient information it takes 3 seconds. So still quite a lot 

What steps can I take to fix this? Alternatives and such

Thanks :)
Shinu
Top achievements
Rank 2
 answered on 14 Jul 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?