Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
542 views
I am simply calling radConfirm which opens up the default "OK" and "Cancel" buttons. However the "Cancel" button does not have focus.
   Is there a property or client side code that can set focus on "Cancel" button
Marin Bratanov
Telerik team
 answered on 08 Nov 2011
3 answers
821 views
I am trying to figure out how to set Checked values in a databound Combobox, using the Q2-2011 version of the control - as seen in this demo:
http://demos.telerik.com/aspnet-ajax/combobox/examples/functionality/checkboxes/defaultvb.aspx

the code below does not seem to be setting the checked values correctly, specifically this line: 

UDFControl.FindItemByValue(tItem).Checked = 
True

The scenario - I am inserting RadComboBoxes into a Placeholder in a Repeater on ItemCreated.  This all works great, I get the comboboxes, the data shows up in the drop down, and I have the Checkboxes, can multi-select, etc.  I just can't seem to set the initial values with the .checked = true

col1.DataType = GetType(String)
col2.DataType = GetType(String)
tData.Columns.Add(col1)
tData.Columns.Add(col2)
 
Dim tCodes As String() = UDF_Data.Rows(currentIndex)("Codes").ToString.Split(uSVM)
Dim tDescriptions As String() = UDF_Data.Rows(currentIndex)("Descriptions").ToString.Split(uSVM)
 
For i = 0 To tCodes.Count - 1
    Dim row As DataRow = tData.NewRow
    row(col1) = tCodes(i)
    row(col2) = tDescriptions(i)
    tData.Rows.Add(row)
Next
 
Dim UDFControl As New Telerik.Web.UI.RadComboBox
UDFControl.ID = UDF_Data.Rows(currentIndex)("ID").ToString.Replace("*", "_")
e.Item.FindControl("UDF").Controls.Add(UDFControl)
UDFControl.DataSource = tData
UDFControl.DataTextField = "Desc"
UDFControl.DataValueField = "ID"
UDFControl.DataBind()
UDFControl.Width = "204"
 
UDFControl.CheckBoxes = True
UDFControl.EnableCheckAllItemsCheckBox = True
UDFControl.EmptyMessage = "Select One or More Values"
Dim tValues As String() = UDF_Data.Rows(currentIndex)("Value").ToString.Split(uSVM)
For Each tItem As String In tValues
    If UDFControl.FindItemByValue(tItem) IsNot Nothing Then
        UDFControl.FindItemByValue(tItem).Checked = True
    End If
Next

Any ideas?

I understand this is a new feature of the Combobox and can't seem to find any examples of how this should be done.
Jayesh Goyani
Top achievements
Rank 2
 answered on 08 Nov 2011
2 answers
143 views
Hello, Telerik Team,

I have a question about hierarchical RadGrids. I have a hierarchical RadGrid, called RadGrid1. Inside RadGrid1.MasterTableView.NestedViewTemplate I have another grid, RadGrid2. Both of the RadGrids are created from code behind. I've defined this relation:

RadGrid1.MasterTableView.NestedViewSettings.ParentTableRelation.Add(New Telerik.Web.UI.GridRelationFields() With {.DetailKeyField = "ID", .MasterKeyField = "ID"})

My question is: How can I get the ID of the parent table in RadGrid2.NeedDatasource event?

Thank you in advance,
Lajos Arpad.
Lajos
Top achievements
Rank 1
 answered on 08 Nov 2011
3 answers
109 views
Rad grid horizontal scroll bar does not move on clicking on the empty area on either right or left side.
Pavlina
Telerik team
 answered on 08 Nov 2011
2 answers
548 views
Hi there,

On an ajaxified button press, I'm adding dynamically-created RadButtons to an asp:Panel control contained within a RadAjaxPanel on a ASP.Net page using a Master Page but no RadAjaxManager.

foreach (CrmSAWorkflowButton wfb in workflowButtons)
{
    RadButton rb = new RadButton();
    rb.ID = "uxWfb" + wfb.UniqueName;
    rb.CausesValidation = false;
    rb.CssClass = "smallSpaceRightAndBelow";
    rb.CommandArgument = wfb.ID.ToStringGuid();
    rb.Text = wfb.Title;
    rb.Click += new EventHandler(rb_Click);
    uxWorkflowButtonsP.Controls.Add(rb);
}

However, when I click the dynamically-created buttons, the server-side postback event does not fire, which I kinda need.

I have tried "ajaxifying" the asp:Panel by adding a RadAjaxManager and adding a new AjaxSetting for the dynamically-created button which updates the asp:Panel, but to no avail: I click the button once, no server-side event and the button stays on the page. I click it again, still no server-side event, the button disappears from the page.

I've also tried using the AjaxRequest method on the AjaxPanel via OnClientClicked on the dynamically-created button, but that (oddly) blows away some underlying data so that's no good.

Any thoughts?
Mike
Top achievements
Rank 1
 answered on 08 Nov 2011
3 answers
110 views

When using both OnUpdateCommand and ClientEvents OnCommand ,  Hierarchy expand and collapse is broken. It will only expand and collapse the first item no matter what row you try to expand. When I remove the <ClientEvents OnCommand="RaiseCommand" /> everything starts working again.

I need to use both because one does the update and the other refreshes the changes in another area.


<
telerik:RadGrid ID="RadGrid1" runat="server" OnPreRender="RadGrid1_PreRender" AutoGenerateEditColumn="True" DataSourceID="SqlDataSourceMain" GridLines="None" OnUpdateCommand="UpdateCommand" Skin="Web20">

 

 

 

<ClientSettings>
<ClientEvents OnCommand="RaiseCommand" />
</ClientSettings>

Any ideas on how I can get this to work?

FULL CODE --------------

 

 

<

 

telerik:RadGrid ID="RadGrid1" runat="server" OnPreRender="RadGrid1_PreRender" AutoGenerateEditColumn="True"

 

 

 

 

 

 

 

 

DataSourceID="SqlDataSourceMain" GridLines="None" OnUpdateCommand="UpdateCommand" Skin="Web20">

 

 

 

 

 

 

 

 

<ClientSettings>

 

 

 

 

 

 

 

 

<ClientEvents OnCommand="RaiseCommand" />

 

 

 

 

 

 

 

 

</ClientSettings>

 

 

 

 

 

 

 

 

 

<MasterTableView AutoGenerateColumns="False" DataKeyNames="Pageid" DataSourceID="SqlDataSourceMain"

 

 

 

 

 

 

 

 

EditMode="InPlace">

 

 

 

 

 

 

 

 

<DetailTables>

 

 

 

 

 

 

 

 

<telerik:GridTableView runat="server" AllowAutomaticUpdates="True" AutoGenerateColumns="False"

 

 

 

 

 

 

 

 

BorderColor="#99CCFF" DataKeyNames="Pageid" DataSourceID="SqlDataSourceSub" EditMode="InPlace"

 

 

 

 

 

 

 

 

GridLines="Both" ShowHeader="False" Name="SubMenus">

 

 

 

 

 

 

 

 

<ParentTableRelation>

 

 

 

 

 

 

 

 

<telerik:GridRelationFields DetailKeyField="Pageid" MasterKeyField="Pageid" />

 

 

 

 

 

 

 

 

</ParentTableRelation>

 

 

 

 

 

 

 

 

<RowIndicatorColumn>

 

 

 

 

 

 

 

 

<HeaderStyle Width="20px" />

 

 

 

 

 

 

 

 

</RowIndicatorColumn>

 

 

 

 

 

 

 

 

<NoRecordsTemplate>

 

 

 

 

 

 

 

 

</NoRecordsTemplate>

 

 

 

 

 

 

 

 

<ExpandCollapseColumn>

 

 

 

 

 

 

 

 

<HeaderStyle Width="20px" />

 

 

 

 

 

 

 

 

</ExpandCollapseColumn>

 

 

 

 

 

 

 

 

<Columns>

 

 

 

 

 

 

 

 

<telerik:GridBoundColumn DataField="ID" HeaderText="ID" UniqueName="ID" Visible="False">

 

 

 

 

 

 

 

 

</telerik:GridBoundColumn>

 

 

 

 

 

 

 

 

<telerik:GridBoundColumn DataField="HitCount" HeaderText="Hit Count" ReadOnly="True"

 

 

 

 

 

 

 

 

UniqueName="HitCount">

 

 

 

 

 

 

 

 

</telerik:GridBoundColumn>

 

 

 

 

 

 

 

 

<telerik:GridTemplateColumn HeaderText="Link" UniqueName="DirectLink">

 

 

 

 

 

 

 

 

<ItemTemplate>

 

 

 

 

 

 

 

 

<a href="javascript:directlink('<%# Eval("id") %>', '<%# Eval("mediaType") %>')">

 

 

 

 

 

 

 

 

<img src="./globalgraphics/Link.gif" alt="Direct Link" border="0" /></a>

 

 

 

 

 

 

 

 

</ItemTemplate>

 

 

 

 

 

 

 

 

</telerik:GridTemplateColumn>

 

 

 

 

 

 

 

 

<telerik:GridBoundColumn DataField="Pageid" HeaderText="Pageid" UniqueName="Pageid"

 

 

 

 

 

 

 

 

Visible="False">

 

 

 

 

 

 

 

 

</telerik:GridBoundColumn>

 

 

 

 

 

 

 

 

<telerik:GridBoundColumn DataField="Title" HeaderText="Title" UniqueName="Title">

 

 

 

 

 

 

 

 

<HeaderStyle Width="220px" />

 

 

 

 

 

 

 

 

</telerik:GridBoundColumn>

 

 

 

 

 

 

 

 

<telerik:GridBoundColumn DataField="mediaType" HeaderText="mediaType" UniqueName="mediaType"

 

 

 

 

 

 

 

 

Visible="False">

 

 

 

 

 

 

 

 

</telerik:GridBoundColumn>

 

 

 

 

 

 

 

 

<telerik:GridCheckBoxColumn UniqueName="MapStatus" HeaderText="MapStatus" DataField="MapStatus">

 

 

 

 

 

 

 

 

</telerik:GridCheckBoxColumn>

 

 

 

 

 

 

 

 

</Columns>

 

 

 

 

 

 

 

 

<AlternatingItemStyle BackColor="#D0DAF3" Font-Bold="False" Font-Italic="False" Font-Overline="False"

 

 

 

 

 

 

 

 

Font-Strikeout="False" Font-Underline="False" Wrap="True" />

 

 

 

 

 

 

 

 

<EditItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False"

 

 

 

 

 

 

 

 

Font-Underline="False" Wrap="False" />

 

 

 

 

 

 

 

 

</telerik:GridTableView>

 

 

 

 

 

 

 

 

</DetailTables>

 

 

 

 

 

 

 

 

<RowIndicatorColumn>

 

 

 

 

 

 

 

 

<HeaderStyle Width="20px" />

 

 

 

 

 

 

 

 

</RowIndicatorColumn>

 

 

 

 

 

 

 

 

<ExpandCollapseColumn Visible="True">

 

 

 

 

 

 

 

 

<HeaderStyle Width="20px" />

 

 

 

 

 

 

 

 

</ExpandCollapseColumn>

 

 

 

 

 

 

 

 

<Columns>

 

 

 

 

 

 

 

 

<telerik:GridBoundColumn DataField="id" DataType="System.Int32" HeaderText="id" ReadOnly="True"

 

 

 

 

 

 

 

 

SortExpression="id" UniqueName="id" Visible="False">

 

 

 

 

 

 

 

 

</telerik:GridBoundColumn>

 

 

 

 

 

 

 

 

<telerik:GridBoundColumn DataField="ClickCount" HeaderText="Counter" ReadOnly="True"

 

 

 

 

 

 

 

 

UniqueName="ClickCount">

 

 

 

 

 

 

 

 

</telerik:GridBoundColumn>

 

 

 

 

 

 

 

 

<telerik:GridBoundColumn DataField="DestinationId" HeaderText="DestinationId" SortExpression="DestinationId"

 

 

 

 

 

 

 

 

UniqueName="DestinationId" Visible="False">

 

 

 

 

 

 

 

 

</telerik:GridBoundColumn>

 

 

 

 

 

 

 

 

<telerik:GridBoundColumn DataField="Title" HeaderText="Title" SortExpression="Title"

 

 

 

 

 

 

 

 

UniqueName="Title">

 

 

 

 

 

 

 

 

</telerik:GridBoundColumn>

 

 

 

 

 

 

 

 

<telerik:GridBoundColumn DataField="Pageid" HeaderText="Pageid" SortExpression="Pageid"

 

 

 

 

 

 

 

 

UniqueName="Pageid" Visible="False">

 

 

 

 

 

 

 

 

</telerik:GridBoundColumn>

 

 

 

 

 

 

 

 

<telerik:GridBoundColumn DataField="PageOrder" DataType="System.Int32" HeaderText="PageOrder"

 

 

 

 

 

 

 

 

SortExpression="PageOrder" UniqueName="PageOrder">

 

 

 

 

 

 

 

 

</telerik:GridBoundColumn>

 

 

 

 

 

 

 

 

<telerik:GridCheckBoxColumn UniqueName="MapStatus" HeaderText="Map On/Off" DataField="MapStatus">

 

 

 

 

 

 

 

 

</telerik:GridCheckBoxColumn>

 

 

 

 

 

 

 

 

</Columns>

 

 

 

 

 

 

 

 

</MasterTableView>

 

 

 

 

 

 

 

 

<FilterMenu EnableTheming="True" Skin="Web20">

 

 

 

 

 

 

 

 

<CollapseAnimation Duration="200" Type="OutQuint" />

 

 

 

 

 

 

 

 

</FilterMenu>

 

 

 

 

 

 

 

 

</telerik:RadGrid>

 

 

 

 

 

 

Vasil
Telerik team
 answered on 08 Nov 2011
6 answers
239 views
Hello,
I am very new to Rad Controls and I am using Custom Edit Template.In my custom Edit Template i have one grid.I populated data from data base to that grid.Problem is, i have one Link button inside my grid , i placed in my Custom Edit Template.And also one label in My Custom Edit Template.In grid link button click Event, i want to find my label which one i placed in side my Custom Edit Template. I am unable to find that label control with in Link Button click which one i placed in grid.Otherwise can we find Inline Insert Template controls in Page load.hoping response will come asap

Note:Grid and label i placed in InlineInsertTemplate.
Vishnu Vardhan Reddy
Top achievements
Rank 2
 answered on 08 Nov 2011
3 answers
318 views

Hi,
   I am working on a form that requires a detail grid view for each Grid object. I have made a main OrderView Grid which just shows the dates for the orders and a child grid that should get the OrderDate from the Parent grid and show orders just for the selected Date in the parent grid. the OrderDate is common between both grids, but when I try to pass in the OrderDate to the child grid as a select param for the Object data source it always comes out something like '1/1'0001' and does not pass in the correct date from the parent grid. I am attaching my sample project as a file along with, I looked at the example at http://demos.telerik.com/aspnet-ajax/grid/examples/programming/detailtabledatabind/defaultcs.aspx
to do this. Can someone please show me how to do this with an example in code?  Your helps appreciated thanks.

  

ASPX PAGE:
  
  
  
        <telerik:RadGrid runat="server" ID="grdOrderDates" Width="750px" Height="100%" AllowPaging="true"
            AllowSorting="true" EnableLinqExpressions="false"
            ShowFooter="true" ondetailtabledatabind="grdOrderDates_DetailTableDataBind">
            <PagerStyle Mode="NextPrevAndNumeric" />
            <MasterTableView AutoGenerateColumns="false" AllowAutomaticDeletes="true" AllowAutomaticInserts="true"
                AllowAutomaticUpdates="true" InsertItemPageIndexAction="ShowItemOnCurrentPage"
                DataKeyNames="OrderDate" CommandItemDisplay="Top" EditMode="PopUp" AllowMultiColumnSorting="true"
                OverrideDataSourceControlSorting="true" AllowFilteringByColumn="true" FilterItemStyle-HorizontalAlign="Left"
                ShowFooter="true" ShowHeader="true" HierarchyLoadMode="ServerOnDemand">
          
                <CommandItemSettings AddNewRecordText="" />
                <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
                </RowIndicatorColumn>
                <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
                </ExpandCollapseColumn>
                   
  
                       <DetailTables>
                          <telerik:GridTableView AutoGenerateColumns="false" DataKeyNames="OrderDate" DataSourceID="ODSOrders">
                                
  
                              <ParentTableRelation>
                                 <telerik:GridRelationFields DetailKeyField="Date" MasterKeyField="OrderDate" />
                              </ParentTableRelation>
                              <Columns>
                                 <telerik:GridBoundColumn DataField="Date" HeaderText="OrderDate" ></telerik:GridBoundColumn>
                                 <telerik:GridBoundColumn DataField="OrderID" HeaderText="OrderID" ></telerik:GridBoundColumn>
                                 <telerik:GridBoundColumn DataField="Customer" HeaderText="Customer" ></telerik:GridBoundColumn>
                                 <telerik:GridBoundColumn DataField="Location" HeaderText="Location" ></telerik:GridBoundColumn>
                                 <telerik:GridBoundColumn DataField="Destination" HeaderText="Destination" ></telerik:GridBoundColumn>
                                 <telerik:GridBoundColumn DataField="Quantity" HeaderText="Quantity" ></telerik:GridBoundColumn>
                                 <telerik:GridBoundColumn DataField="QuantityRemaining" HeaderText="Quantity Remaining" ></telerik:GridBoundColumn>
                              </Columns>
                          </telerik:GridTableView>
                       </DetailTables>
  
                <Columns>
                    <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn">
                        <HeaderStyle></HeaderStyle>
                    </telerik:GridEditCommandColumn>
                    <telerik:GridBoundColumn DataField="OrderDate" UniqueName="OrderDate" HeaderText="Order Date" />
  
                </Columns>
                  
              
            </MasterTableView>
            <GroupingSettings CaseSensitive="False" />
              
        </telerik:RadGrid>
    </div>
  
     
    <asp:ObjectDataSource ID="ODSOrderList" runat="server" TypeName="DAL.OrderRepository"
        DataObjectTypeName="DAL.OrderView" SelectMethod="getOrderDatesinRange" 
    onselecting="ODSOrderList_Selecting">
       <SelectParameters>
             <asp:Parameter Name="StartDate" DbType="DateTime" />
             <asp:Parameter Name="EndDate" DbType="DateTime" />
       </SelectParameters>
    </asp:ObjectDataSource>
      
    <asp:ObjectDataSource ID="ODSOrders" runat="server" TypeName="DAL.OrderRepository"
        DataObjectTypeName="DAL.Order" SelectMethod="getOrderListinRange" >
      <SelectParameters>
             <asp:SessionParameter Name="orderDate" SessionField="OrderDate" DbType="DateTime" />
       </SelectParameters>
    </asp:ObjectDataSource>
      
   </asp:Content>
  
  
C# Code :
  
 protected void Page_Load(object sender, EventArgs e)
        {
  
        }
  
        public void LoadOrdersByDate()
        {
            //Loads Parent Grid when date range for Orders is given and binds Parent grid
            grdOrderDates.DataSourceID = "ODSOrderList";
            grdOrderDates.DataBind();
        }
  
        protected void ODSOrderList_Selecting(object sender, ObjectDataSourceSelectingEventArgs e)
        {
            e.InputParameters["StartDate"] = CalStartDate.SelectedDate;
            e.InputParameters["EndDate"] = CalEndDate.SelectedDate;
        }
  
        protected void BtnSubmit_Click(object sender, EventArgs e)
        {
            //Loads Parent Grid when date range for Orders is given and binds Parent grid
            LoadOrdersByDate();
        }
  
  
        protected void grdOrderDates_DetailTableDataBind(object sender, Telerik.Web.UI.GridDetailTableDataBindEventArgs e)
        {
            try
            {
  
                GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem;
                DateTime orderDate = Convert.ToDateTime(dataItem.GetDataKeyValue("OrderDate"));
  
                e.DetailTableView.DataSourceID = "ODSOrders";
  
                //Pass in the OrderDate value from the Parent grid so the child grid only shows Orders for the selected Date
                ODSOrders.SelectParameters["orderDate"].DefaultValue = orderDate.ToString();
  
                e.DetailTableView.DataBind();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Jayesh Goyani
Top achievements
Rank 2
 answered on 08 Nov 2011
1 answer
52 views
Hey,

     we are in main development phase. i strucked in middle of the development as i am not able bind the treeview when one child has multiple parents.

    But i wanna to achieve this in any way as it is our main concept of development. Please find the below structure.

 

 

DataTable data = new DataTable();

 

data.Columns.Add(

 

"ParentID");

 

data.Columns.Add(

 

"ChildID");

 

data.Columns.Add(

 

"Text");

 

data.Rows.Add(

 

null, "1", "Market 1");

 

data.Rows.Add(

 

null, "2", "Market 2");

 

data.Rows.Add(

 

"1", "1", "1_Client");

 

data.Rows.Add(

 

"1", "2", "2_Client");

 

data.Rows.Add(

 

"2", "1", "1_Client");

 

data.Rows.Add(

 

"2", "4", "4_Client");

 

data.Rows.Add(

 

"2", "5", "5_Client");

 

 

radTreeClientMarket.DataFieldID =

 

"ChildID";

 

radTreeClientMarket.DataFieldParentID =

 

"ParentID";

 

radTreeClientMarket.DataTextField =

 

"Text";

 

radTreeClientMarket.DataSource = data;

radTreeClientMarket.DataBind();

here , child "1_client" is having two parents and my tree view also should be in the way around.

Please reply me as soon as possible as all stopped in this.

Thanks,
Priya

Shinu
Top achievements
Rank 2
 answered on 08 Nov 2011
3 answers
199 views

hello,

i am working on email functionality and recently i  am using rad uploader to upload files and send to mails through smtp connection.the code that i wrote working fine in localsystem,but when we deploy it on IIS(V 5.1 or 7) it is getting error,path cannot be found /access  to path is  denied ,i am sending code block  please reply soon ,Thanks.

System.Net.Mail.Attachment attachment;
           foreach (UploadedFile file in RadUpload1.UploadedFiles)
           {
               try
               {
                   string strFileName = null;
                    strFileName = System.IO.Path.GetFullPath(file.FileName);
                   attachment = new System.Net.Mail.Attachment(strFileName);
                   Message.Attachments.Add(attachment);
                  }
         catch
           {
           }
    }

 

Saimadhukar
Top achievements
Rank 1
 answered on 08 Nov 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?