Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
124 views
Whenever I put HTML into the Group Header Item, as per Telerik instruction, eroneous "<p> </p>"
tags are being inserted above and below my content.
If I just have plain text (ie not HTML) then I don't get this behavour.
I need to use HTML to format my data/text.

This is my code, using literal but it didnt make any difference whether directly or via the literal.
protected void gridResults_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
{
 
    if (e.Item is GridGroupHeaderItem)
    {
        StringBuilder sb = new StringBuilder();
 
        sb.Append("<div style=\"width:500px; overflow-x:auto; overflow-y:hidden; \">");
        sb.Append("  <div style=\"width:400px;\">");
        sb.Append("    <div style=\"width:100px; float:left;\">Name </div>");
        sb.Append("    <div style=\"width:100px; float:left;\">Year Level </div>");
        sb.Append("    <div style=\"width:100px; float:left;\">Classes </div>");
        sb.Append("  </div>"); // row.
        sb.Append("</div>"); // table.
 
        GridGroupHeaderItem groupHeaderItem = (GridGroupHeaderItem)e.Item;
        Literal literal = new Literal();
        literal.Text = sb.ToString();
        groupHeaderItem.DataCell.Controls.Add(literal);
    }
}
PatrickS
Top achievements
Rank 1
 answered on 11 Apr 2013
4 answers
240 views
Hi

Is it possible to disable the content area of a PanelBar ie the RadPanelItem section., such that anything in the content are cant be clicked, but the sections can be expanded and collapsed.

Andy

Andy Green
Top achievements
Rank 2
 answered on 11 Apr 2013
3 answers
104 views
In my grid I have dynamically Created some Template Columns with TextBox as ItemTemplate control. My problem is that i couldnt
find that control When an external Save button is clicked. My code is here. Can anyone tell me what is the problem. Thanks in advance

  private void rgAddColumns()
        {
            int c = rgEmpOverTimeCalculation.Columns.Count;
 
            OvertimeTypeList objlist = new OvertimeTypeList();
            ListParams LP = new ListParams();
            LP.Add("@OvertimeTypeID", "%");
             
            LP.Add("Culture", SecurityUtility.Culture());
            objlist.GetList(LP);
 
            int TypeCount = objlist.Count;
            for (int k = 0; k < TypeCount; k++)
            {
                GridTemplateColumn Column = new GridTemplateColumn();
                
                Column.HeaderText = objlist[k].OvertimeType.ToUpper();
                Column.HeaderStyle.Font.Size =10;
                Column.HeaderStyle.ForeColor =System.Drawing.Color.Maroon;
                Column.HeaderStyle.Font.Bold = true;
                Column.UniqueName = objlist[k].OvertimeType.Replace(" ", String.Empty) + objlist[k].OvertimeTypeID;
                Column.Visible = true;
                 
                Column.ItemTemplate = new MyTemplate(Column.UniqueName);
 
                rgEmpOverTimeCalculation.MasterTableView.Columns.Add(Column);
            }
        }
 
 
public class MyTemplate : ITemplate
{
 
    protected RadNumericTextBox textBox;
    protected CheckBox boolValue;
    private string colname;
    public MyTemplate(string cName)
    {
        colname = cName;
    }
 
    
    public void InstantiateIn(System.Web.UI.Control container)
    {
 
        textBox = new RadNumericTextBox();
        textBox.ID = "txt"+colname;
        container.Controls.Add(textBox);
        
 
    }
 
}
   protected void rbtnSaveOvertime_Click(object sender, EventArgs e)
        {
            foreach (GridDataItem item in rgEmpOverTimeCalculation.MasterTableView.Items)
            {
                RadNumericTextBox txtOvertimeInHrs = (RadNumericTextBox)item[rgEmpOverTimeCalculation.Columns[5].UniqueName].FindControl("txt" + rgEmpOverTimeCalculation.Columns[5].UniqueName);     //returns null
            }
        }
Shinu
Top achievements
Rank 2
 answered on 11 Apr 2013
1 answer
158 views
Hi,

When I do the Cut-Paste operations on the folder in RadTree, the Context menu gets fixed in the tree.
For Ex.
If we cut the folder and paste it in some another folder. Then again cut the same folder and paste it in its previous position.
Then, there is a javascript error occurs and the context menu gets fixed until, we are not refreshing the page.

Please follow the steps in attached screen shots.

I will provide the code of CutPaste and Refresh tree node, if necessary.
--
Prakash
Kate
Telerik team
 answered on 11 Apr 2013
1 answer
137 views
We have an event receiver that gets called on ItemAdded of a list. This list implements the RadEditor on a 'Body' field. When the code grabs the value of this field, is contains the entire markup instead of just the text which the user has entered in the editor. How do we just get the text and not the HTML?
public override void ItemAdded(SPItemEventProperties properties)
{
    SPListItem postItem = properties.ListItem;
      string body = postItem["Body"]; //This returns all markup - we only want the user entered text from radeditor
}
Stanimir
Telerik team
 answered on 11 Apr 2013
1 answer
288 views
Recently, I am implementing the numericTextbox, also I wanna the key of "arrow up" and "down" for other javascript function.
I only can disable the default "increase function" .  please help. Thanks
Angel Petrov
Telerik team
 answered on 11 Apr 2013
1 answer
115 views
Hi,

How to I access other column(not the value or text) of a selected item in javascript ?
like the ContactTitle column ?

also want to know server side

<script type="text/javascript">

 

function IndexChanging(sender, eventArgs) {

</script>

 

<telerik:RadComboBox runat="server" AutoPostBack="true" ID="RadComboBox1" Height="190px" Width="420px"

MarkFirstMatch="true" EnableLoadOnDemand="true"

HighlightTemplatedItems="true" OnClientSelectedIndexChanging="IndexChanging"

OnItemDataBound="RadComboBox1_ItemDataBound"

Label="Grid-like multi-column:"

OnSelectedIndexChanged="RadComboBox1_SelectedIndexChanged">

<HeaderTemplate>

<ul>

<li class="col1">Contact Name</li>

<li class="col2">City</li>

<li class="col3">Title</li>

</ul>

</HeaderTemplate>

<ItemTemplate>

<ul>

 

<li class="col1">

<%

 

# DataBinder.Eval(Container.DataItem, "ContactName")%></li>

<li class="col2">

<%

# DataBinder.Eval(Container.DataItem, "City") %></li>

<li class="col3">

<%

# DataBinder.Eval(Container.DataItem, "ContactTitle") %></li>

</ul>

</ItemTemplate>

<FooterTemplate>

A total of

 

<asp:literal runat="server" id="RadComboItemsCount" />

items

</FooterTemplate>

</telerik:RadComboBox

thanks
J-Francois

Princy
Top achievements
Rank 2
 answered on 11 Apr 2013
1 answer
118 views
When i bind a grid to a datareader in the needdatasource like this:

Dim rs As SqlDataReader = SqlHelper.ExecuteReader(GetConnectionString("mv4Conn", "mvdata", ConfigurationManager.AppSettings("CircViewDB")), Data.CommandType.Text, sbFilter.ToString)
               Me.RadGrid1.DataSource = rs

should i be using the USING keywod like this:

Using reader As SqlDataReader = getReader()
    ddlCustomer.DataSource = reader
End Using
 
to make sure that the datareader is disposed of?

thanks,
Dana







Shinu
Top achievements
Rank 2
 answered on 11 Apr 2013
0 answers
78 views
Hi,
I have an application that uses a radgrid control, and is returning over 500 records from a database. I need to enable sorting and paging features. Ideally I would like the grid to store the data client side and NOT do postbacks everytime a page is changed or a column is sorted.  

For Telerik controls, the only demo I can find is "Grid - Client-Side Binding and Caching". However, the Databinding location is a webservice. Is there any chance that the Databind location can be a SQL Server database ?
AAA
Top achievements
Rank 1
 asked on 10 Apr 2013
1 answer
154 views
<telerik:GridTemplateColumn Datafield="customer_cd" HeaderStyle-Width="20%"
    HeaderText="Customer" ItemStyle-HorizontalAlign="Center" SortExpression="end_dt"
    ItemStyle-VerticalAlign="Middle" UniqueName="customer_cd">
    <ItemTemplate>
        <table>
            <colgroup>
                <col />
            </colgroup>
            <tr>
                <td>
                    <asp:HyperLink ID="hlCustomerCd" runat="server" ImageUrl='<%# string.Format("icons/{0}.gif",Eval("customer_cd")) %>' NavigateUrl='<%# string.Format("customer.aspx?org_cd={0}&cust_id={1}", org_cd, Eval("customer_id"))  %>'
                        Text='<%# Eval("customer_nm").ToString() %>' />
                    <br />
                    <asp:Label ID="lblCustomerCd" runat="server" Text='<%# Eval("customer_nm").ToString() %>' Font-Size="X-Small" />
                    <br />
                    <asp:HyperLink ID="hlAgreementNo" runat="server" NavigateUrl=' <%# string.Format("agreement.aspx?org_cd={0}&cust_id={1}&agmt_id={2}", org_cd, Eval("customer_id"), Eval("agreement_id"))%>' Text='<%# "Agreement:" + Eval("customer_purchase_order_no") %>' ForeColor="#2dabc1" />
                </td>
            </tr>
        </table>
    </ItemTemplate>
</telerik:GridTemplateColumn>

protected void rgSite_PreRender(object sender, EventArgs e)
{
    //The Row Index is the Row above the bottom row, walk up the Grid
    for (int rowIndex = rgSite.Items.Count - 2; rowIndex >= 0; rowIndex += -1)
    {
        //The Current Row is the row index
        GridDataItem row = rgSite.Items[rowIndex];
        //The Previous Row is one below it
        GridDataItem previousRow = rgSite.Items[rowIndex + 1];
        //Grab the ItemTemplate Text values from the Hyperlink of the current and previous row and compare them.
        if ((row["customer_cd"].FindControl("hlCustomerCd") as HyperLink).Text == (previousRow["customer_cd"].FindControl("hlCustomerCd") as HyperLink).Text)
        {
            //The Top Row Absorbs the previous Rowspan
            row["customer_cd"].RowSpan = previousRow["customer_cd"].RowSpan < 2 ? 2 : previousRow["customer_cd"].RowSpan + 1;
            //The previous row then goes away.
            previousRow["customer_cd"].Visible = false;
        }
    }
}

This is sort of a minor adjustment to the solution given in another forum to allow for the same thing in a Grid Template Column. 
MasterChiefMasterChef
Top achievements
Rank 2
 answered on 10 Apr 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?