Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
1.3K+ views
Dear Telerik Team,

When I am trying to display data using radgrid I am getting error like "Index was out of range. Must be non-negative and less than the size of the collection. Parameter: Index".

Here is my code

<telerik:RadGrid ID="gvCktMap" BorderColor="White" runat="server" AutoGenerateColumns="true" 
                                AllowSorting="true" BackColor="White" AllowPaging="true" PageSize="25" GridLines="None" 
                                OnPageIndexChanging="gvCktMap_PageIndexChanging" OnRowCancelingEdit="gvCktMap_RowCancelingEdit" 
                                OnRowCommand="gvCktMap_RowCommand" OnRowUpdating="gvCktMap_RowUpdating" OnRowDataBound="gvCktMap_RowDataBound" 
                                OnSorting="gvCktMap_Sorting" OnRowEditing="gvCktMap_RowEditing" ShowGroupPanel="True" 
                                EnableHeaderContextMenu="true" EnableHeaderContextFilterMenu="true" AllowMultiRowSelection="true" 
                                AllowFilteringByColumn="True" AllowCustomPaging="false" OnItemCreated="gvCktMap_ItemCreated" 
                                EnableViewState="false" OnNeedDataSource="gvCktMap_NeedDataSource" OnItemUpdated="gvCktMap_ItemUpdated" 
                                > 
                                <MasterTableView DataKeyNames="sId" UseAllDataFields="true"
                                    <Columns> 
                                        <telerik:GridBoundColumn UniqueName="sId" HeaderText="sId" DataField="sId" Visible="false"
                                        </telerik:GridBoundColumn> 
                                        <telerik:GridBoundColumn UniqueName="orderId" HeaderText="orderId" DataField="orderId"
                                        </telerik:GridBoundColumn> 
                                        <telerik:GridBoundColumn UniqueName="REJ" HeaderText="REJ" DataField="REJ"
                                        </telerik:GridBoundColumn> 
                                        <telerik:GridBoundColumn UniqueName="Desc" HeaderText="Desc" DataField="Desc"
                                        </telerik:GridBoundColumn> 
                                        <telerik:GridBoundColumn UniqueName="CustomerName" HeaderText="CustomerName" DataField="CustomerName"
                                        </telerik:GridBoundColumn> 
                                        <telerik:GridBoundColumn UniqueName="MarketName" HeaderText="MarketName" DataField="MarketName"
                                        </telerik:GridBoundColumn> 
                                        <telerik:GridBoundColumn UniqueName="HeadendName" HeaderText="HeadendName" DataField="HeadendName"
                                        </telerik:GridBoundColumn> 
                                        <telerik:GridBoundColumn UniqueName="SiteName" HeaderText="SiteName" DataField="SiteName"
                                        </telerik:GridBoundColumn> 
                                        <telerik:GridBoundColumn UniqueName="TaskStatus" HeaderText="TaskStatus" DataField="TaskStatus"
                                        </telerik:GridBoundColumn> 
                                    </Columns>
                                 </mastertableview>
                            </telerik:RadGrid> 


Here is my code behind

private void bingGrid() 
    { 
        try 
        { 
            gvCktMap.Columns.Clear(); 
            DataSet dsResult = new DataSet(); 
            DataSet dsEditItems = new DataSet(); 
            dsEditItems.ReadXml(Server.MapPath("XMLS/" + Session["TaskID"].ToString() + ".xml")); 
 
            clsSearch_BL clsObj = new clsSearch_BL(); 
            clsObj.TaskID = (string)Session["TaskID"]; 
            clsObj.CustName = (string)Session["CustName"]; 
            clsObj.MarketName = (string)Session["MarketName"]; 
            clsObj.HeadendName = (string)Session["HeadendName"]; 
            clsObj.SiteName = (string)Session["SiteName"]; 
            clsObj.TaskStatus = (string)Session["TaskStatus"]; 
            clsObj.OrdType = (string)Session["OrdType"]; 
            clsObj.OrdStatus = (string)Session["OrdStatus"]; 
            clsObj.ProName = (string)Session["ProName"]; 
            clsObj.LOC = (string)Session["LOC"]; 
 
            dsResult = clsObj.getSearchResults_BL(clsObj); 
            Session["SearchRes"] = dsResult; 
            DataTable dtFilter = new DataTable(); 
            DataColumn dtCol = new DataColumn("FilterBy"); 
            dtFilter.Columns.Add(dtCol); 
            dtCol = new DataColumn("DataType"); 
            dtFilter.Columns.Add(dtCol); 
            gvCktMap.DataSource = dsResult
            gvCktMap.DataBind(); 
    } 
        catch (Exception ex) 
        { 
        } 
    } 


If i remove <MasterTableView></MasterTableView> Its working fine without any error. But for some reasons i need to use <MasterTableView></MasterTableView> Can anyone help me out to fix this error.

Thanks In Advance



Yavor
Telerik team
 answered on 16 Jun 2010
3 answers
205 views
hi,
I m new in telerik control.

i have radgrid and in iwant inplace edit,delete,insert.
for edit ,delete column sholud not be separate. it should have icon(edit,delete) in single colum. so any body can give me example.how it will do.
thanks in advance.
rock
Top achievements
Rank 1
 answered on 16 Jun 2010
1 answer
93 views
I am using a tabstrip that consists of 2 tabs and in each RadPageView i have a RadRotator. When the page loads the selected tab displays the rotator with the items in it correctly with the size specified but when i click on the 2nd tab the size becomes smaller.When i go back to 1st tab the size is still small.What do i have to do to keep the size of the rotator as declared?I tried the

EnableEmbeddedBaseStylesheet

 

="true"

 

 

 

 


but it didnt work or i am using it incorrectly.This is my code in .aspx :

 

<telerik:radtabstrip ID="RadTabStripbooks" runat="server" MultiPageID="RadMultiPagebooks"   
SelectedIndex="0" dir="rtl" Skin="" >   
 <Tabs>   
  <telerik:RadTab Text=" " CssClass="tabStrip1" PageViewID="RadPageView1b">     
  </telerik:RadTab>   
  <telerik:RadTab Text=" " CssClass="tabStrip2" PageViewID="RadPageView2b" >   
  </telerik:RadTab>   
 </Tabs>   
 </telerik:radtabstrip> 
 
<telerik:RadMultiPage ID="RadMultiPagebooks" runat="server" SelectedIndex="0" dir="rtl" Width="100%" EnableEmbeddedBaseStylesheet="true" >   
    
    <telerik:RadPageView ID="RadPageView1b" runat="server" BackColor="#a6ce39" >   
       <div style="width:100%;">   
          <telerik:RadRotator ID="RadRotator1" runat="server" Height="190px" width="100%" BackColor="#a6ce39" RotatorType="ButtonsOver" ItemHeight="100px"   ItemWidth="165px" DataSourceID="XmlDataSource1" Skin="Windows7"     EnableEmbeddedBaseStylesheet="true" >   
                 <ItemTemplate>   
                           <div class="itemTemplate">  
                                       SOME CODE......   
   
                             </div>   
                      </ItemTemplate>   
        </telerik:RadRotator>   
      </div> 
  </telerik:RadPageView>   
   
<telerik:RadPageView ID="RadPageView2b" runat="server" BackColor="#526b75" >   
  <div style="width:100%;">  
         <telerik:RadRotator ID="RadRotator2b" runat="server" Height="190px" width="100%" BackColor="#526b75"   
 RotatorType="ButtonsOver" ItemHeight="100px" ItemWidth="165px" DataSourceID="XmlDataSource2" Skin="Windows7"   EnableEmbeddedBaseStylesheet="true" >   
         <ItemTemplate>   
           <div class="itemTemplate">  
                SOME CODE......   
   
           </div>   
       </ItemTemplate>   
  </telerik:RadRotator>   
  </div> 
 </telerik:RadPageView>   
</telerik:RadMultiPage>   
  
maha
Top achievements
Rank 1
 answered on 16 Jun 2010
1 answer
145 views
Hi,

I am using telerik Tabstrip control. in that i have made one RadMultiPage. in that i have created 3 RadPageView. i am getting access of all the control which are in the first RadPageView. For the other 2 RadPageViews i need to get them using findcontrol.

is there any other solution to this?

Thanks.
Yana
Telerik team
 answered on 16 Jun 2010
5 answers
257 views
I want to create a masked number input format like "#####:##"
The first ##### part present the number of hours, and the later "##" part represent the number of mins

The database stores the field in turns of minutes. What I am doing is to calculate the number of hours and place it in the first part, and so as the mins. 

I found the masked text box will always place the hour strin on the left of "#####", i.e. Say I have 230 hours and 14 mins, the textbox display it like this:      "230__:14". 

What I am expecting is : "__230:14", could you suggest what setting is missing?

Thanks,
Michael


Radoslav
Telerik team
 answered on 16 Jun 2010
3 answers
270 views
hello,

I need to disable AJAX on RadGrid's one command for file download purpose and so I, first, made use of client settings and there used onCommand client side where I make AJAX disabled which works fine at its part
So the flow goes first at client side and first enables/disables AJAX and then goes server side on ItemCommand event where I can not access e.Item's values and even data key value

Please refer to my code snippet for server side event-ItemCommand:

GridEditableItem editedItem = e.Item as GridEditableItem; 
Hashtable newValues = new Hashtable(); 
editedItem.ExtractValues(newValues); 
Yavor
Telerik team
 answered on 16 Jun 2010
0 answers
53 views
Hey all,

I have a table in my db with some null values, when I execute a function on this table like for example insert values to it I leave the null value column with no value ( I don't insert anything in it) , it places value 0 in it but i want it to be null. what to do?
hamda
Top achievements
Rank 1
 asked on 16 Jun 2010
1 answer
147 views
Hi,

   We have a bunch of splitters inside a form on a page. The height of the form is initially set to 100%. We have some JScript that changes the height of the form to 89% but when this executes, nothing happens until you resize the browser window and the Telerik magic kicks in and resizes all the panes.

   Want I think I need to do is manually call the functions that do this resizing after I set the new height of 89%. Can someone tell me how to do this i.e. what the function/functions are called?

Kind Regards
ADe
Svetlina Anati
Telerik team
 answered on 16 Jun 2010
1 answer
184 views
Hello,

Much like most SharePoint admins out there, we'll be upgrading out SharePoint environment to 2010 in the near future.  We have widely used the RAD Editor Lite webpart in our 2007 farm and from what I can see, there is no version for 2010.  So depending on the possible answers to this question, if there is no 2010 version, what are my other options?  If removal is necessary, how can I remove RAD Editor Lite from my 2010 test farm so I don't see this error all over the place...

Could not load file or assembly 'RadEditorSharePoint, Version=4.5.6.0, Culture=neutral, PublicKeyToken=1f131a624888eeed' or one of its dependencies. The system cannot find the file specified.

Thanks

Stanimir
Telerik team
 answered on 16 Jun 2010
1 answer
104 views
Let me show a simple code below.


.aspx

<telerik:RadChart ID="RadChart3" runat="server" Width="1000" />


.aspx.cs

protected void Page_Load(object sender, EventArgs e)
    {

        DataTable chartdata = new DataTable();
        chartdata.Columns.Add("date", typeof(DateTime));
        chartdata.Columns.Add("value", typeof(double));

        
        List<string> dates = new List<string>();
        dates.Add("2010-06-01 02:44:35.753");
        dates.Add("2010-06-01 02:45:54.753");
        dates.Add("2010-06-01 02:47:13.543");
        dates.Add("2010-06-01 02:48:32.600");
        dates.Add("2010-06-01 02:49:51.730");
        dates.Add("2010-06-01 02:51:10.640");

        List<double> values = new List<double>();
        values.Add(120);
        values.Add(130);
        values.Add(140);
        values.Add(150);
        values.Add(160);
        values.Add(170);

        int k = 0;

        foreach (string strdate in dates)
        {
            DataRow cdr = chartdata.NewRow();
            cdr[0] = DateTime.Parse(strdate);
            cdr[1] = values[k];

            chartdata.Rows.Add(cdr);

            k++;           
        }

        ChartSeries series = RadChart3.CreateSeries("value", Color.DarkBlue, Color.Empty, ChartSeriesType.Bar);
            
        foreach (DataRowView drv in chartdata.DefaultView)
        {
            ChartSeriesItem item = new ChartSeriesItem();
            item.XValue = DateTime.Parse(drv["date"].ToString()).ToOADate();
            item.YValue = Math.Round(double.Parse(drv["value"].ToString()), 1);

            series.Items.Add(item);
        }

        RadChart3.AutoLayout = true;

        RadChart3.Series.Add(series);
        RadChart3.Appearance.BarWidthPercent = 1;

        RadChart3.PlotArea.XAxis.AutoScale = false;
        RadChart3.PlotArea.XAxis.Appearance.ValueFormat = Telerik.Charting.Styles.ChartValueFormat.ShortTime;
        RadChart3.PlotArea.XAxis.AddRange(DateTime.Parse("2010-06-01 02:42:00").ToOADate(), DateTime.Parse("2010-06-01 02:52:00").ToOADate(), (double)1 / 1440);

        RadChart3.PlotArea.YAxis.AutoScale = true;

}





And the chart is expected to show six bars.

Actually, however, the chart shows only 2 bars, because they are overlapped.

How can I solve this problem?


Thank you.

-Alex.



Ves
Telerik team
 answered on 16 Jun 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?