Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
210 views
I am trying to establish a master/detail relationship in my grid.  For a reason I can not understand, the detail row appears in every master record.  Can someone please point me to my mistake?

Here is my code:

<MasterTableView DataKeyNames="ID" DataSourceID="sqlBidDetail" EditMode="InPlace" CommandItemDisplay="Top" HierarchyLoadMode="ServerBind">
     <DetailTables>
          <telerik:GridTableView runat="server" AllowSorting="False" AutoGenerateColumns="True" DataKeyNames="DescriptionDetailID,BidDetailID" DataSourceID="sqlDescriptionDetail" EditMode="InPlace" CommandItemDisplay="Top" HierarchyLoadMode="ServerBind">
                <ParentTableRelation>
                        <telerik:GridRelationFields DetailKeyField="tblDescriptionDetail.BidDetailID" MasterKeyField="ID" />
                </ParentTableRelation>
           </DetailTables>
</MasterTableView>

and my 2 SQL data sources.

<asp:SqlDataSource ID="sqlBidDetail" runat="server" ConnectionString="<%$ ConnectionStrings:dbBidManager %>"
SelectCommand="SELECT tblBidDetail.ID, tblBidDetail.BidID, tblBidDetail.ULAID, tblBidDetail.ProductID FROM tblBidDetail" />
 
<asp:SqlDataSource ID="sqlDescriptionDetail" runat="server" ConnectionString="<%$ ConnectionStrings:dbBidManager %>"
SelectCommand="SELECT tblDescriptionDetail.DescriptionDetailID, tblDescriptionDetail.BidDetailID, tblDescriptionDetail.DescriptionTypeID FROM tblDescriptionDetail" />

There is a FK relationship between tblDescriptionDetail.BidDetailID and tblBidDetail.ID.  Note though that
tblDescriptionDetail.DescriptionDetailID is the primary key in that table.

Jon
Top achievements
Rank 1
 answered on 02 Jul 2013
1 answer
134 views
I am using AjaxToolkit to have popup for editing image. When I click on Crop or Resize button, the popup for imageeditor shows up behind AjaxToolkit popup. How do I make sure they show up on top?

I am using the latest 2013.2.611.40.
Marin Bratanov
Telerik team
 answered on 02 Jul 2013
1 answer
112 views
HI,

I am using Editor control in my application. I have some content in database has some links(site address) also but while loading the Editor with data it is displaying the site address but not with hyper links. How to enable links in Editor control please help me.


Thanks,
Marin Bratanov
Telerik team
 answered on 02 Jul 2013
1 answer
55 views
Hi,
unfortunately, some relevant functionality within RadGrid has been changed by you from version 2011 to 2013, that made the following things stop working:
1) paging in custom pager does not work anymore when other value has been set in the pagers' combo and then - navigating to different page: it resets to default value = 100 records per page
2) sorting does not work properly anymore, it's ignored when clicking the same column's header a second time sequentially
3) i have special custom buttons in template columns, they used to raise some popups and then, if confirmed, caused some postback action. Now it also does not work anymore.

And maybe other things I still have not noticed...

I cannot provide you with a sample for the moment, it's quite complicated to prepare it. I'd suggest you to tell what have you changed from the old verion to the new one, that could affect all this? What events I need to look at and maybe change something??
Alexander
Top achievements
Rank 1
 answered on 02 Jul 2013
1 answer
137 views
http://demos.telerik.com/aspnet-ajax/dropdowntree/examples/functionality/filtering/defaultcs.aspx

hi sorry my english badly,

i want to use this demos with LinqDatasource in 300.000 rows 


thanks


Peter Filipov
Telerik team
 answered on 02 Jul 2013
1 answer
248 views
I have a grid where on the ItemDataBound event, Im using some custom checking on the columns based on a list of objects from my database to see if the column can be edited or not. For the ones that can be edited, I then created a RegularExpressionValidator for the table cell along with setting the maxlength of the textbox when its in edit mode. This works perfectly until when I go to update the record. The way Im doing it is to grab the edited cell, build a gridRow and then remove that currently selected GridRow (the one being edited) and insert the new one using the new values from the edited row.

Here is my regular expression building
GridEditableItem item = e.Item as GridEditableItem;
 
//this is within a loop for the columns and another loop for my custom objects (metaData)
//set edit textbox max length
item[column.UniqueName].Enabled = true;
TextBox txtbx = (TextBox)item[column.UniqueName].Controls[0];
txtbx.MaxLength = metaData.MaxFieldLength;
 
//set regular expression for validation
RegularExpressionValidator regex = new RegularExpressionValidator();
GridTextBoxColumnEditor editor = (GridTextBoxColumnEditor)item.EditManager.GetColumnEditor(column.UniqueName);
TableCell cell = (TableCell)editor.TextBoxControl.Parent;
 
editor.TextBoxControl.ID = "Validation" + column.UniqueName;
 
regex.Display = ValidatorDisplay.Dynamic;
regex.ControlToValidate = editor.TextBoxControl.ID;
regex.ForeColor = System.Drawing.Color.Red;
regex.ValidationExpression = @"^";
//custom regex expression building
regex.ValidationExpression = regex.ValidationExpression + @"$";
 
cell.Controls.Add(regex);


I get this values by during my grid_UpdateCommand event and call
//get selected row
GridEditableItem item = (GridEditableItem)e.Item;
//get values from the row
Hashtable newValues = new Hashtable();
e.Item.OwnerTableView.ExtractValuesFromItem(newValues, item);


The row Im dealing with is working weird because during this call, the 2 columns textboxes that arent enabled (think like ReadOnly but the user can still see the values) are getting the new record values fine, but the 2 user editable textboxes are pulling back a null. When I turn the regular expression building off (comment it out), it pulls the records perfectly with all the column values. But when I have the regular expression building and checking on, it cant pull these values? Any reason why?
Angel Petrov
Telerik team
 answered on 02 Jul 2013
4 answers
255 views
Hi,

Just trying to set the selected value of combobox in code behind, but it is not working out:
RadComboBox1.DataSource = ds.Tables[0];
RadComboBox1.DataTextField = "Text";
RadComboBox1.DataValueField = "ID";
RadComboBox1.DataBind();
if (ds.Tables[1].Rows.Count > 0)
{
  RadComboBox1.SelectedValue = ds.Tables[1].Rows[0]["ID"].ToString();
}

The stored procedure I'm calling return correct data.

Any help??
Peter Filipov
Telerik team
 answered on 02 Jul 2013
1 answer
184 views


this works great when I want to run the script TestWbform1 on my radwindow

 

function Test2(arg0, arg1, arg2, arg3, arg4) {
    var oWnd = $find("<%=AssmntContentWindow.ClientID%>");
    oWnd.get_contentFrame().contentWindow.TestWbform1(arg0, arg1, arg2, arg3, arg4);
}

 

if I place the script in the masterpage of my radwindow, it no longer works. Can you tell me how to access it there?

Marin Bratanov
Telerik team
 answered on 02 Jul 2013
1 answer
88 views
Hi 

In one of my page, I am using this control to upload a single zip file. So does it provide an option to extract contents at the target some how?

Thanks
Sameer
Shinu
Top achievements
Rank 2
 answered on 02 Jul 2013
1 answer
127 views
Hi,
  I have a dynamic created grid and the Grid have GridTemplateColum which contains a hyperlink. I want To format Hyperlink Text to currency. I tried below, but does not work
string Price = ((DataRowView)container.DataItem)[colname].ToString();
           link.Text = String.Format("{0:C}", Price);
#region Create GridTemplate column
   private void CreateTemplateColumn(DataTable dt, ref RadGrid rg, string FromYearMonth, string ToYearMonth)
   {
       foreach (DataColumn dc in dt.Columns)
       {
           if (dc.ColumnName == "Vendor" || dc.ColumnName == "vendorID")
               continue;
           if (dc.ColumnName != "Vendor" && dc.ColumnName != "VendorID")
           {
               string ColName = dc.ColumnName;
               string[] DPMNameAndID = ColName.Split(';');
               string DPMName = DPMNameAndID[0];
               string DMPId = DPMNameAndID[1];
               GridTemplateColumn templateColumn = new GridTemplateColumn();
               templateColumn.ItemTemplate = new MyTemplate(ColName, FromYearMonth, ToYearMonth, DPMName, DMPId);
               templateColumn.SortExpression = ColName;
               templateColumn.HeaderText = DPMName;
               templateColumn.HeaderStyle.Font.Bold = true;
               templateColumn.FooterStyle.Font.Bold = true;
               templateColumn.FooterAggregateFormatString = "{0:C}";
               templateColumn.DataField = ColName;
               templateColumn.Aggregate = Telerik.Web.UI.GridAggregateFunction.Sum;
               rg.MasterTableView.Columns.Add(templateColumn);
           }
       }
   }
 
   private class MyTemplate : ITemplate
   {
 
       protected HyperLink SealeByVendorTrans;
 
       private string colname;
       private string _fromDate;
       private string _toDate;
       private string _DPMName;
       private string _DPMId;
       public MyTemplate(string cName, string fromDate, string toDate, string DPMName, string DPMId)
       {
           colname = cName;
           _fromDate = fromDate;
           _toDate = toDate;
           _DPMName = DPMName;
           _DPMId = DPMId;
       }
       public void InstantiateIn(System.Web.UI.Control container)
       {
           SealeByVendorTrans = new HyperLink();
           SealeByVendorTrans.ID = colname;
           SealeByVendorTrans.DataBinding += new EventHandler(SealeByVendorTrans_DataBinding);
           container.Controls.Add(SealeByVendorTrans);
       }
       void SealeByVendorTrans_DataBinding(object sender, EventArgs e)
       {
           HyperLink link = (HyperLink)sender;
           GridDataItem container = (GridDataItem)link.NamingContainer;
           string Price = ((DataRowView)container.DataItem)[colname].ToString();
           //txtPrice.Text = String.Format("{0:C}", price);
           link.Text = String.Format("{0:C}", Price);
              
           link.NavigateUrl = "HinoPartsDashBoardTransactions.aspx?type=Vendor&TransType=V&DPMName=" + _DPMName + "&DPM=" + _DPMId + "&from=" + _fromDate + "&to=" + _toDate + "&VendorID=" + ((DataRowView)container.DataItem)["VendorID"].ToString() + "&Vendor=" + ((DataRowView)container.DataItem)["Vendor"].ToString();
       }
   }
   #endregion
Maria Ilieva
Telerik team
 answered on 02 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?