Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
142 views
Hi All,

I have a Rad Grid and its having 3 columns (ItemID, ItemCode, ItemName) i wish to get the all row values of ItemID and the value need set to an array in a private function....
how can i achieve this .. please help..

Regards,

Prassin
Shinu
Top achievements
Rank 2
 answered on 08 Aug 2012
0 answers
57 views
Nevermind. Seems you already fixed the problem with the SP1 release.
Constantin
Top achievements
Rank 1
 asked on 08 Aug 2012
1 answer
83 views
Have a couple of grids and buttons to add and remove values from the grids. Both use 'NeedDataSource' and Custom Paging to get data. All of these controls are in an asp:Panel with I have ajaxified with RadAjaxManager. When I select items in the one grid and click on the button to add them to the other grid, the NeedDataSource is being called before the Click event. I think this is causing different records to populate that grid because using ExtractValues on a SelectedItem is returning values that are different from what was selected. And, those values are appearing the the grid on PostBack. Is this standard behavior? How can I get the selected values and move the data before the data is repopulated with NeedDataSource?
Tsvetoslav
Telerik team
 answered on 08 Aug 2012
3 answers
635 views
Hello

As  I stated I am getting Sys.WebForms.PageRequestManagerServerErrorException:    and the status code is 500.

I undesrstand that some thing is wrong  but not sure what it is

I get this error  only when there are more rows  ( For example I don't get this error if there are 100 rows, but if there are 240 rows I do get this error)
I  have Radgrid in RadAjaxPanel  and on clicking edit button from Command row I am placing complete grid in Editmode thru server code

I  edit 2 columns ( I have about  10 columns  in total and I have 2 levels of grouping)

I attached a script to edit fields and save the indexes of rows changed
When user clicks the save button, I am issuing a  Ajaxrequest with array of indexes to update

I am getting the error when i click the Save button.

While starting if there are less number of rows it works fine, but if I change the search and retrieve more number of rows and place them in edit mode and save , I get the errror  and now if I  change search  I get some object null  page.

I am not sure what is the reason for the error .  Does placing more number of rows in editmode creating this error

Thanks
Radoslav
Telerik team
 answered on 08 Aug 2012
1 answer
128 views
Hi all!,

I need to validate that some textboxes are required. Can I validate them in one TextBoxSetting section as a whole?.

<telerik:RadInputManager ID="RadInputManager1" runat="server">
    <telerik:TextBoxSetting BehaviorID="txtSettings" ErrorMessage="Requerido.">
        <Validation IsRequired="true" ValidationGroup="vgSolicitud" />
        <TargetControls>
            <telerik:TargetInput ControlID="celular" />
            <telerik:TargetInput ControlID="fechaocurrencia" />
            <telerik:TargetInput ControlID="sintomas" />
        </TargetControls>
    </telerik:TextBoxSetting>
</telerik:RadInputManager>

Thanks for the help guys!.

Regards,
Nelson Campos.
Caracas, Venezuela. 
Princy
Top achievements
Rank 2
 answered on 08 Aug 2012
2 answers
145 views
How do I go about making the tabstrip's selected tab rotate?

For example, every 3 seconds the selected tab would change from the 1st, to 2nd, 3 seconds later, from 2nd to 3rd, and 3 seconds later, back to the 1st. 

I hope I didn't overlook anything in the forums or documentation, but I didn't see anything like this

<telerik:RadTabStrip
            ID="RadTabStrip1" runat="server"
    MultiPageID="RadMultiPage1" SelectedIndex="0" BackColor="#FBFCDD"
            CssClass="RadTabStrip_Default" EnableEmbeddedSkins="False" >
    <Tabs>
        <telerik:RadTab runat="server" Text="News" CssClass="rtsLink" SelectedCssClass="rtsSelected" Selected="True">
        </telerik:RadTab>
        <telerik:RadTab runat="server" Text="Sports" CssClass="rtsLink" SelectedCssClass="rtsSelected">
        </telerik:RadTab>
        <telerik:RadTab runat="server" Text="Weather" CssClass="rtsLink" SelectedCssClass="rtsSelected">
        </telerik:RadTab>
        <telerik:RadTab runat="server" Text="Publications & Photo Galleries" CssClass="rtsLink"  SelectedCssClass="rtsSelected">
        </telerik:RadTab>
    </Tabs>
</telerik:RadTabStrip>
 <telerik:RadMultiPage ID="RadMultiPage1" Runat="server" SelectedIndex="0">
    <telerik:RadPageView ID="RadPageView1" runat="server"><uc3:News_Latest ID="News_Latest1" runat="server" NewsTag="General" ShowTop="5" /></telerik:RadPageView>
    <telerik:RadPageView ID="RadPageView2" runat="server"><uc3:News_Latest ID="News_Latest2" runat="server" NewsTag="Sports" ShowTop="5" /></telerik:RadPageView>
    <telerik:RadPageView ID="RadPageView3" runat="server"><asp:Literal
            ID="ltWeather" runat="server"></asp:Literal>
        <br /></telerik:RadPageView>
    <telerik:RadPageView ID="RadPageView4" runat="server"><asp:Literal
            ID="ltPhotos" runat="server"></asp:Literal></telerik:RadPageView>
</telerik:RadMultiPage>
.
DTech
Top achievements
Rank 1
 answered on 08 Aug 2012
11 answers
185 views
Hello all,

I have a scenario that I'm hoping will be relatively painless for those who are better versed in radgrid than I am.  I have a grid which I'm using to record component replacement serial numbers but in this scenario it is up to the user to determine if the component will be replaced or not meaning some of the serial numbers change while others do not.  I would like the grid to come up with the old serial numbers (as shown in the attached picture) and empty fields for all of the new serial # column (the last column).  If the user determines that a part is being kept then they'll click the "keeping" checkbox which will copy the old serial to the new serial field and disable the new serial field so it cannot be edited.  When they're all done they'll click a submit button which will then submit the data to be saved.  My problem is that I have no idea how to get just the last column with text entry fields that are editable as soon as the grid loads.  The same goes for the checkboxes.  I followed the article about putting all items in edit mode during pre-render but it only seems to work on the last row, not all of the rows.  I'm at a loss.  Any help guiding me in the right direction would be very much appreciated!

FYI - this site is currently using RadControls 2010 Q3 but we're considering upgrading it to 2012 Q2.  It's more of a cost/benefit question right now but if it'll help make this process any easier then the upgrade to 2012 Q2 will definitely be approved.

Regards,
Tim
Shinu
Top achievements
Rank 2
 answered on 08 Aug 2012
0 answers
79 views
How can i load .aspx page in below code instead of usercontrol page

< protected void Page_Load(object sender, System.EventArgs e)
            {
                if (!Page.IsPostBack)
                {
                    AddTab("Orders");
                    AddPageView(RadTabStrip1.FindTabByText("Orders"));
                    AddTab("Products");

                   
                }
            }

       private void AddTab(string tabName)
       {
           RadTab tab = new RadTab();
           tab.Text = tabName;
           RadTabStrip1.Tabs.Add(tab);
       }

       

       protected void RadMultiPage1_PageViewCreated(object sender, RadMultiPageEventArgs e)
       {
           string userControlName = e.PageView.ID + ".ascx";

           Control userControl = Page.LoadControl(userControlName);
           userControl.ID = e.PageView.ID + "_userControl";

           e.PageView.Controls.Add(userControl);
       }

            private void AddPageView(RadTab tab)
            {
                RadPageView pageView = new RadPageView();
                pageView.ID = tab.Text;
                RadMultiPage1.PageViews.Add(pageView);
                pageView.CssClass = "pageView";
                tab.PageViewID = pageView.ID;
            }

            

            protected void RadTabStrip1_TabClick(object sender, RadTabStripEventArgs e)
            {
                AddPageView(e.Tab);
                e.Tab.PageView.Selected = true;
            }>
Atif
Top achievements
Rank 1
 asked on 08 Aug 2012
3 answers
286 views
I need to hide control called dtParticipationEndDate only on add mode. How i can achive?


<telerik:RadGrid ID="rdParticipationList" runat="server" OnNeedDataSource="ParticipationGrid_NeedDataSource" 
                                    OnItemDataBound="ParticipationGrid_ItemDataBound" OnItemCommand="ParticipationGrid_ItemCommand"
                                    AllowPaging="true" AllowSorting="true" Width="930px" OnInsertCommand="ParticipationGrid_ItemInserted"
                                    OnEditCommand="ParticipationGrid_EditCommand" OnUpdateCommand="ParticipationGrid_ItemUpdated">
                                    <MasterTableView CommandItemDisplay="Top" AutoGenerateColumns="false" DataKeyNames="ParticipationID"
                                        EditMode="InPlace" InsertItemPageIndexAction="ShowItemOnCurrentPage">
                                        <CommandItemTemplate>
                                            <asp:LinkButton ID="add" runat="server" Text="Add New Record" CommandName="InitInsert"></asp:LinkButton>
                                            <asp:LinkButton ID="save" runat="server" Text="Add new Record" CommandName="PerformInsert" Visible="false"></asp:LinkButton>
                                        </CommandItemTemplate>
                                        <Columns>
                                            
                                            <telerik:GridTemplateColumn HeaderText="Participant" ItemStyle-Width="240px" UniqueName="Participant">
                                                <ItemTemplate>
                                                    <%#DataBinder.Eval(Container.DataItem, "FullName")%>
                                                </ItemTemplate>
                                                <EditItemTemplate>
                                                   
                                                     <telerik:RadComboBox ID="ddlStudentList" runat="server" DataSourceID="dsFullName" DataTextField="StudentName" DataValueField="EnrolmentID" 
                                                     SelectedValue = '<%# Eval("EnrolmentID") %>'>  
                                                        <Items>
                                                            <telerik:RadComboBoxItem Value="0" Text="-- Select a Value --" />
                                                        </Items>
                                                    </telerik:RadComboBox>
                                                   
                                                    <asp:RequiredFieldValidator ID="vStudentList" runat="server" ErrorMessage="*"
                                                        ControlToValidate="ddlStudentList"></asp:RequiredFieldValidator>
                                                </EditItemTemplate>
                                            </telerik:GridTemplateColumn>
                                         
                                  
                                            <telerik:GridTemplateColumn HeaderText="Start Date" UniqueName="StartDate" HeaderStyle-Width="10%" DataType="System.DateTime">
                                                <ItemTemplate>
                                                    <%#DataBinder.Eval(Container.DataItem, "ParticipationStart","{0:dd MMMM yyyy}")%>
                                                </ItemTemplate>
                                                <EditItemTemplate>
                                                    <telerik:RadDatePicker ID="dtParticipationStartDate" runat="server" Skin="Office2007" DateInput-DateFormat="dd MMM yyyy" DbSelectedDate='<%# Eval("ParticipationStart") %>'
                                                        DateInput-Width="20px" DateInput-CssClass="controlText" DateInput-Enabled="true"
                                                        Calendar-ShowRowHeaders="false" AutoPostBack="true">
                                                    </telerik:RadDatePicker>
                                                   <asp:RequiredFieldValidator ID="vDateStart" runat="server" ErrorMessage="*"
                                                        ControlToValidate="dtParticipationStartDate"></asp:RequiredFieldValidator>
                                                </EditItemTemplate>
                                            </telerik:GridTemplateColumn>


                                            <telerik:GridTemplateColumn HeaderText="End Date" UniqueName="EndDate" HeaderStyle-Width="10%">
                                                <ItemTemplate>
                                                    <%#DataBinder.Eval(Container.DataItem, "ParticipationEnd", "{0:dd MMMM yyyy}")%>
                                                </ItemTemplate>
                                                <EditItemTemplate>
                                                    <telerik:RadDatePicker ID="dtParticipationEndDate" runat="server" Skin="Office2007" DateInput-DateFormat="dd MMM yyyy" DbSelectedDate='<%# Eval("ParticipationEnd") %>'
                                                        DateInput-Width="20px" DateInput-CssClass="controlText" DateInput-Enabled="true"
                                                        Calendar-ShowRowHeaders="false" AutoPostBack="true">
                                                    </telerik:RadDatePicker>
                                                  
                                                </EditItemTemplate>
                                            </telerik:GridTemplateColumn>


                                            <telerik:GridTemplateColumn HeaderText="Reason For Leaving" ItemStyle-Width="240px" UniqueName="ReasonForLeaving" DataType="System.DateTime">
                                                <ItemTemplate>
                                                    <%#DataBinder.Eval(Container.DataItem, "ReasonForLeaving")%>
                                                </ItemTemplate>
                                                <EditItemTemplate>
                                                     <telerik:RadComboBox ID="ddlReasonLeaving" runat="server" DataSourceID="odsReasonForLeaving" DataTextField="ReasonForLeaving" DataValueField="ReasonForLeavingID" 
                                                     SelectedValue = '<%# Eval("ReasonForLeavingID") %>'>  
                                                        <Items>
                                                            <telerik:RadComboBoxItem Value="0" Text="-- Select a Value --" />
                                                        </Items>
                                                    </telerik:RadComboBox>
                                                   
                                                </EditItemTemplate>
                                            </telerik:GridTemplateColumn>
                                            <telerik:GridBoundColumn DataField="ParticipationNotes" HeaderText="Notes" HeaderStyle-Width="30%" UniqueName="Note" Visible="false" />
                                  
                                           <telerik:GridEditCommandColumn UniqueName="EditColumn" ButtonType="LinkButton"></telerik:GridEditCommandColumn>
                                        </Columns>
                                    </MasterTableView>
                                </telerik:RadGrid>
Mark de Torres
Top achievements
Rank 1
 answered on 08 Aug 2012
2 answers
151 views
Dear Telerik support team,

In the "Grid / Form Template Edit Form" example on this website, in Default.CS.aspx.cs class, there's a code block which runs when the user updates a record as shown below.



protected void RadGrid1_ItemUpdated(object source, Telerik.Web.UI.GridUpdatedEventArgs e)
{
if (e.Exception != null)
{
e.KeepInEditMode = true;
e.ExceptionHandled = true;
DisplayMessage(true, "Employee " + e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["EmployeeID"] + " cannot be updated. Reason: " + e.Exception.Message);
}
else
{
DisplayMessage(false, "Employee " + e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["EmployeeID"] + " updated");
}
}



The code above displays the notification message "Employee 3 updated"
If I want this notification message to display a message like "Employee Robert King updated"  how do I accomplish this?

I tried to use the code shown below but I don't think the code works correctly because the variable IDNumber gets the value from the field EmployeeID rather than the RadGrid's ItemIndex which starts from 0.

int IDNumber = (int)e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["EmployeeID"];

string EmployeeName = RadGrid1.MasterTableView.Items[IDNumber]["FirstName"].Text;

DisplayMessage(false, "Employee " + EmployeeName + " updated")

 

Many thanks,

ILJIMAE
Top achievements
Rank 1
 answered on 08 Aug 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?