Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
126 views


See the Attachment ,

string RMS = FileUpL.UploadedFiles[0].GetName();      this's the way i'm getting the file name in server side ,
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index

Error Come Like That

Thanks Advance,
Mohamed.
mohamed
Top achievements
Rank 1
 answered on 13 Jul 2012
1 answer
80 views
Hi,
I have a grid that is bound to a data source:

<telerik:RadGrid ID="gvVerwendungen" runat="server" PageSize="15" 
                         AllowPaging="True" Width="100%"  AutoGenerateColumns="false"
                         OnNeedDataSource="gvVerwendungen_NeedDataSource" ShowStatusBar="true">
  
            <MasterTableView Width="100%" Summary="RadGrid table"  ShowFooter="true">
                <Columns>
                    <telerik:GridTemplateColumn UniqueName="CheckBoxTemplateColumn">
                        <ItemTemplate>
                            <asp:CheckBox ID="Auswahl" runat="server" AutoPostBack="True" OnCheckedChanged="Auswahl_ToggleRowSelection" />
                        </ItemTemplate>
                        <HeaderTemplate>
                            <asp:CheckBox ID="headerChkbox" runat="server" AutoPostBack="True" />
                        </HeaderTemplate>
                    </telerik:GridTemplateColumn>
  
                    <telerik:GridBoundColumn FooterText="Dienststelle" UniqueName="Dienststelle" 
                                             HeaderText="Dienststelle" DataField="Dienststelle">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn FooterText="Beginn" UniqueName="Beginn" 
                                             HeaderText="Beginn" DataField="Beginn"
                                             DataType="System.DateTime" DataFormatString="{0:dd/MM/yy}">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn FooterText="Sachbezug" HeaderText="Sachbezug"
                                             DataField="Bezug">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn FooterText="Status" UniqueName="VerwendungsStatus"
                                             DataField="VerwendungsStatus">
                    </telerik:GridBoundColumn>
                </Columns>
            </MasterTableView>
  
            <PagerStyle Mode="NextPrevAndNumeric" />
  
        </telerik:RadGrid>

In the code behind there is the event code:

protected void gvVerwendungen_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
        {
               if (mitarbeiter != null && mitarbeiter.VerwendungseintraegeAktuelleUndGeplante != null)
                {
                    this.gvVerwendungen.DataSource = mitarbeiter.VerwendungseintraegeAktuelleUndGeplante;
                }
                             
        }

This works fine.
For the selection of the row I want to use a checkbox:
protected void Auswahl_ToggleRowSelection(object sender, EventArgs e)
       {
           ((sender as CheckBox).NamingContainer as GridItem).Selected = (sender as CheckBox).Checked;
           bool checkHeader = true;
             
             
           foreach (GridDataItem dataItem in gvVerwendungen.MasterTableView.Items)
           {
               // Auswahl is the name of the ckeckbox-column
               if (!(dataItem.FindControl("Auswahl") as CheckBox).Checked)
               {
                   checkHeader = false;
                     
                   break;
               }
           }
           GridHeaderItem headerItem = gvVerwendungen.MasterTableView.GetItems(GridItemType.Header)[0] as GridHeaderItem;
           (headerItem.FindControl("headerChkbox") as CheckBox).Checked = checkHeader;
           if (gvVerwendungen.SelectedItems.Count > 0)
           {
               // gvVerwendungen is the name of the grid
               GridDataItem dataItem = gvVerwendungen.SelectedItems[0] as GridDataItem;
               // Question: How can I get the bound custom object?
               // Problem: The custom object has no ID
           }
           else
           {
               tbStellenzeichen.Text = "Nothing";
           }
       }

My Question: How can I get the custom object instance of the current row?

For a hint, I would be grateful
Kind regards.
Christian
Andrey
Telerik team
 answered on 13 Jul 2012
1 answer
175 views

Trying to access an <asp:dropdownlist> from <telerik:GridTemplateColumn> in the ItemCommand event of a RadGrid. 

 

 

BarID is the unique column name on the template column
ddlBarID is the id of the dropdownload

GridEditFormItem editedItem = (GridEditFormItem)((GridDataItem)e.Item).EditFormItem;
DropDownList ddlBar = 
(DropDownList)editedItem["BarID"].FindControl("ddlBarID");
Label1.Text = "BarID null: " + (ddlBar == null).ToString();
ddlBar.Items.Add("TEST");

 

 

I get Object reference not set to an instance of an object.


any help is appreciated.  been banging my head on this one for two days now.

 

Shinu
Top achievements
Rank 2
 answered on 13 Jul 2012
3 answers
92 views
Hi,
I have a situation in which in case of monthview display only no. of appointment on that day and in dayview i have to show appointments. I have written code on OnTimeSlotCreated event for counting no. of appointments and it works fine, but appointments is also display in monthview. How can i only display no. of appointments on that day not actual appointments.
Andy
Top achievements
Rank 1
Iron
 answered on 12 Jul 2012
2 answers
226 views
Hi.

I have a page with several RadTabStrip/RadMultiPage combinations.  One of them dynamically loads copies of the same user control (with a parameter from the value of its RadTab) into correlating RadPageViews.  I have a 'Delete' button on the contained usercontrol that deletes its specific data.  So, then the whole RadTabStrip and PageViews needs to be rebound to reflect the change (which will have one less tab/pageview after the delete).  I can do this easily by simply reloading the whole page, but I would like to be more elegant, and do that with ajax.  How can a button event on a single PageView's usercontrol locate the containing RadTabStrip, and initiate a rebind via ajax?

Thanks for any help!!

Tom Stanley
T. Stanley
Top achievements
Rank 1
 answered on 12 Jul 2012
1 answer
81 views
Is it possible to disable Appointment Inline Insert and Edit
Tudor Dragos
Top achievements
Rank 1
 answered on 12 Jul 2012
2 answers
108 views
Hi Telerik,
I'm facing the following issue: If "Insert External Video" tool is launched in RadEditor (which itself is displayed in RadWindow), its' buttons are hidden (because of small screen resolution), but no scrollbars are shown (see the image attached). Is there a way how to force the "Insert External Video" tool window to have scrollbars displayed?
Thanks in advance.
Regards
Zdenek Jelinek
Rumen
Telerik team
 answered on 12 Jul 2012
1 answer
130 views

 

Hello,

I am new to Telerik. I am struggling with finding a list of methods and properties for the RAD controls.

 I can see from intellisense that the controls have a lot to offer.

 I was able to find the code samples, I downloaded the "Rad Controls AJAX Courseware", and found other documents online - but I was did not find a list of properties and methods (like the you would find on the MSDN site).

 Can someone direct me to the right location please?

 Thank you,

Slav
Telerik team
 answered on 12 Jul 2012
5 answers
161 views
I am getting XSL data in the RadEditor with EditMode as HTML in the mark-up. But the Editor is automatically modifying my XSL data and showing it in Rad Editor. I want exact same data to be shown. I tried adding ContentFilter="ConvertToXhtml" but it didn't work.

What should I do to show my XSL data in Rad Editor exactly same as in database?

FYI: I have set Rad Editor in Editmode="HTML" so there is no option of switching modes.

HELP!!!!!!!!!
Rumen
Telerik team
 answered on 12 Jul 2012
5 answers
153 views
Hi, Telerik Team

How to automatically change the start time and end time of appointment item to new value after moving the appointment item in telerik Scheduleview to new place?
Plamen
Telerik team
 answered on 12 Jul 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?