Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
177 views
Is it possible to set the DefaultInsertValue property of a RadGrid with a form control such as TextBox? I have tried the following code without success.

<telerik:GridBoundColumn DataField="ItemID"

FilterControlAltText="Filter column column" HeaderText="Item ID"

 

UniqueName="ItemID" DefaultInsertValue='<% TextBox1.Text %>'>

 

</telerik:GridBoundColumn>


the radgrid control is bound to an entitydatasource  having a two part key one of which is a foreign key needing to be populated with the current entity set's pk.
tony
Top achievements
Rank 1
 answered on 04 May 2012
2 answers
309 views
Hi,

I'm trying to hide all sections on a line graph where the Y value = 0.

All the solutions i have found require me to use a single series bound to the charts data source property. I'm using a list of chart series that i add to the chart object, so the ItemDataBound event does not get fired.

Attached is the output graph, i need to remove all points before the arrows on each series.

Is there a way to do this? 

Much appreciated
Nick
Top achievements
Rank 1
 answered on 04 May 2012
1 answer
172 views
I would like to know if my usage of the NeedDataSource event is correct.

<telerik:RadListView ID="rlvResults" runat="server" AllowPaging="True"
    ItemPlaceholderID="SearchResultsHolder" DataKeyNames="Id" Skin="Web20"
    EnableEmbeddedSkins="False" OnNeedDataSource="rlvResults_NeedDataSource">
    <LayoutTemplate>
        <asp:Panel ID="SearchResultsHolder" runat="server" />
        <div style="clear: both" />
        <div>
            <telerik:RadDataPager ID="rdpSearchResultsPager" runat="server"
                PagedControlID="rlvResults" PageSize="5">
                <Fields>
                    <telerik:RadDataPagerButtonField FieldType="FirstPrev" />
                    <telerik:RadDataPagerButtonField FieldType="Numeric" />
                    <telerik:RadDataPagerButtonField FieldType="NextLast" />
                    <telerik:RadDataPagerPageSizeField PageSizeText="Page size: " />
                </Fields>
            </telerik:RadDataPager>
        </div>
    </LayoutTemplate>
    ...
</RadListView>

code behind:

protected void Page_Load(object sender, EventArgs e)
{
    if (!Page.IsPostBack)
    {
        ...
    }
}
 
protected void rlvResults_NeedDataSource(object sender, Telerik.Web.UI.RadListViewNeedDataSourceEventArgs e)
{
    if (Page.IsPostBack)
    {
        rlvResults.DataSource = GetData();
    }
}
 
protected void bSearch_Click(object sender, EventArgs e)
{
    rlvResults.DataSource = GetData();
    rlvResults.DataBind();
}

This is a search page. When bSearch is clicked the results should be shown in rlvResults. On Page_Load!Page.IsPostBack  the listview should not display any items.

I've added a check to only get data for the listview when it's a client postback event (paging, sorting, etc). Is this the correct usage for this event?
Brian
Top achievements
Rank 1
 answered on 03 May 2012
2 answers
139 views
I am currently using a RadTreeView as a system menu and trying to implement loading nodes on demand for better performance. The problem I am running into is whenever a call is made to either a page-based method or an asmx web service I can't determine the user making the call because HttpContext.Current.User.Identity.IsAuthenticated is always false, even though the user is actually logged in. My guess is this has to do with the way the request is being sent to the server since adding a section in the web.config blocking access to the page/service to unauthenticated users gets me an "authentication failed" error when expanding a node.

What suggestions do you recommend for people in this situation? I'd prefer not to do server-side loads since those require so much extra data to be sent (viewstate, etc.).
digitall
Top achievements
Rank 1
 answered on 03 May 2012
3 answers
143 views
Ok I am trying to make my headers static but when I do it works and looks fine, except when I expand the width of the grid to the left or right. On the right side of the grid where the headers are there is white space when it should be showing the column headers. Screen shots are shown below. 1) is this a known issue? 2) Is there a work around or am I doing something wrong?

Caleb
Top achievements
Rank 1
 answered on 03 May 2012
2 answers
251 views
I am trying to retrieve the values of Checkbox which is inside a template column, build from the codebehind dynamically.
 
protected void Page_Init(object sender, EventArgs e)
{       
    DefineGridStructure();
private void DefineGridStructure()
{       
    GridBoundColumn boundColumn;
    boundColumn = new GridBoundColumn();
    RadGridAttendance.MasterTableView.Columns.Add(boundColumn);
    boundColumn.DataField = "Name";
    boundColumn.HeaderText = "Name";
        
        string session_id = dt.Rows[i]["web_submission_id"].ToString();          
        GridTemplateColumn templateColumn = new GridTemplateColumn();
        templateColumn.ItemTemplate = new MyTemplate(session_id,db);            
        templateColumn.UniqueName = session_id;
        RadGridAttendance.MasterTableView.Columns.Add(templateColumn);
     
}

Code for Template:

class MyTemplate : ITemplate
{
    private string colname;
    protected CheckBox cbAttended;
    private string query;
    private string session_id;   
    private DataLib_oracle db;
     
    public MyTemplate(string sessionid, DataLib_oracle dbo)
    {
        colname = sessionid;
        session_id = sessionid;
        db = dbo;
    }
 
 
    public void InstantiateIn(System.Web.UI.Control container)
    {       
        cbAttended = new CheckBox();
        cbAttended.Attributes["session_id"] = session_id;
        container.Controls.Add(cbAttended);
        cbAttended.DataBinding += new EventHandler(cbAttended_DataBinding);
        cbAttended.ID = session_id;       
        //cbAttended.Checked = true;
        //cbAttended.Enabled = false;       
    }
 
 
    void cbAttended_DataBinding(object sender, EventArgs e)
    {
        string attended;
        CheckBox cBox = (CheckBox)sender;       
        GridDataItem container = (GridDataItem)cBox.NamingContainer;
        string personnel_id = ((DataRowView)container.DataItem)["personnel_id"].ToString();
        cbAttended.Attributes["personnel_id"] = personnel_id;
        string session_id = cBox.Attributes["session_id"].ToString();
         
        //Eval("Attended").ToString() == "1"
        //cBox.Checked = (bool)((DataRowView)container.DataItem)["Bool"];
 
 
        query = " SELECT ATTENDED FROM   WEB_ATTENDEES WHERE PERSONNEL_ID = " + personnel_id + " AND SESSION_ID = " + session_id;
        attended = db.GetStrDescFromID(query, WebKit.ConnectionString);
 
 
        if (attended=="1")
            cBox.Checked = true;
    }
      
}

On clicking Save button of this page, am trying to retrieve the values of checkboxes.

foreach (GridDataItem item in RadGridAttendance.MasterTableView.Items)
 {
            string test = RadGridAttendance.Columns[1].UniqueName;
            CheckBox cb = (CheckBox)(item[test].FindControl(test));
}
In the above code, there are no controls available in  item[test] .
cb is returning null.

Note the unique name of the column and the ID of the checkbox are same.

Please let me know how do i retrieve the checkbox.

Thanks in advance,
Mani


Manikandan Balasubramaniyan
Top achievements
Rank 1
 answered on 03 May 2012
1 answer
155 views
Hello,
I am using radnumeric textbox to enter discount at highlevel. If the user changes the discount on other items in the page, I want to clear the RadNumeric Textbox value. I am clearing the textbox using JQuery. On the UI, it is showing as cleared but again when I click on textbox, it is showing the value and on postback also that textbox is showing the same value. Is there any settings I have to change in RadNumeric Textbox
Here is my Code.

  <telerik:RadNumericTextBox  ID="txtDiscountlevel" runat="server" CssClass="BodyCopy" MaxLength="5" AutoCompleteType="None"  
                                      Type="Number" ShowSpinButtons="false" AllowOutOfRangeAutoCorrect="false" InvalidStyle-Font-Bold="true">
                                      <NumberFormat AllowRounding="false" DecimalDigits="3"  KeepNotRoundedValue="true" GroupSizes="4"/>
                                  </telerik:RadNumericTextBox> 

                      <telerik:RadNumericTextBox  ID="txtNewPrice" runat="server" MaxLength="10"  AutoCompleteType="None"  MinValue="0"  CssClass="CurPriceTxtbox" 
                            Width="50px"  Type="Number" ShowSpinButtons="false" AllowOutOfRangeAutoCorrect="false" InvalidStyle-Font-Bold="true">
                                      <NumberFormat AllowRounding="false" DecimalDigits="2"  KeepNotRoundedValue="true" GroupSizes="3"/>
                                       <ClientEvents OnValueChanging="ValueChanged" OnError="HandleError"/>
                                  </telerik:RadNumericTextBox>

function ValueChanged(sender, args) {
          $("#txtDiscountlevel_text").val('');
             }

Richard
Top achievements
Rank 1
 answered on 03 May 2012
1 answer
92 views
Hello, How i can call a function of asp.net from OnRowSelected of RadGrid using javascript?? 

I have a function of asp.net in the server side and i need called from javascript for use in the event OnRowSelected of RadGrid in the client side:

the name of my function is LLenar_txt


Jayesh Goyani
Top achievements
Rank 2
 answered on 03 May 2012
1 answer
219 views
Hi,  I'm using Telerik web controls version 2012.1.215.35.  I have a RadTextBox with the TextMode property set to "MultiLine"  

<telerik:RadTextBox runat="server" InputType="Text" ID="rtbSearch" Width="500px" TextMode="MultiLine"  Rows="5" EmptyMessage="Please enter numbers, maximum of 5, one per line."></telerik:RadTextBox>

A button then calls some JavaScript code that retrieves the value of the RadTextBox using get_textBoxValue() and sends it over to a different page as a QueryString. I noticed however that it converts any line feeds like this:

12345
67892
01234 

to this:

12345<br>67892<br>01234

which causes an issue since the receiving page is expecting a line feed (Chr(10) + Chr(13)) and not HTML tags to separate the values.  How can I prevent this?  Thank you.
Richard
Top achievements
Rank 1
 answered on 03 May 2012
1 answer
158 views
Hi,
I have a grid, with a column called ProcessName, which contains data from various processes.

In the codebehind, i can successfully create a filter like so:
column = RadGrid2.MasterTableView.GetColumnSafe("ProcessName")
column.CurrentFilterFunction = GridKnownFunction.EqualTo
column.CurrentFilterValue = cboProductSelectedValue
 
RadGrid2.MasterTableView.FilterExpression = "([ProcessName] = 'Process1')"
RadGrid2.MasterTableView.Rebind()

This filters the grid as you would expect.
I wish to find 2 values in the column, and believe I should use BETWEEN but i'm unsure of the syntax. I changed the code to:

column = RadGrid2.MasterTableView.GetColumnSafe("ProcessName")
column.CurrentFilterFunction = GridKnownFunction.Between
column.CurrentFilterValue = "Process1 Process2"
  
RadGrid2.MasterTableView.FilterExpression = "([ProcessName] BETWEEN 'Process1 Process2')"
RadGrid2.MasterTableView.Rebind()

but it doesn't work. Could anyone help me please? 

Thanks

Chris
Elliott
Top achievements
Rank 2
 answered on 03 May 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?