Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
478 views

Hi,

I have a checkbox set up as such:

<

 

 

telerik:GridCheckBoxColumn DataField="HaulSampledTrueFalse" HeaderText="Haul Sampled?" Visible="false" UniqueName="HaulSampledTrueFalse" EditFormColumnIndex="1"></telerik:GridCheckBoxColumn>

Could someone please advise how to set the state of the checkbox to "ticked" if the data field that the checkbox is bound to, is True.

Thanks, Ida

 

Ida
Top achievements
Rank 1
 answered on 15 Oct 2013
2 answers
114 views
Hi , 
Im using Telerik 2011 Q3 . How can i setting title text format ( color , police ... )  in a radImageTile ? i don't find property ...

Thank's .  
SOFIENE
Top achievements
Rank 1
 answered on 15 Oct 2013
1 answer
65 views
Hi,
I have an unusual question regarding listview. I have used many controls like drop down , gridview etc but didn't find anything like to rebind the control whenever its selectedindexchanged event is fired?

But today when i was working with the Listview of which i was firing its SelectedIndexChanged event on item selection, what i noticed that the event runs successfully for the first time and details of the item selected is shown but as soon as some other item is selected, the event throws an error on the code where it accepts the item value - as shown below

ArgumentOutOfRangeException :
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index

Exception is thrown when : 

ItemID = ItemListView.SelectedValue.ToString();


 I Though of rebinding it in the event itself and the problem went away.
I am still confused that why i should rebind listview in the SelectedIndexChanged event.

Thanks for reading and any usefull info will be appreciated ..!!
Kostadin
Telerik team
 answered on 15 Oct 2013
1 answer
92 views
Hi,
Iam using Radgrid for ASP.NET project.
In my grid i have 3 textbox column
for Qty,Price and Total Amont as textbox.
Using clientscript i do calculate on Qty*Price textbox value and update the result in Total Amount text box.

upto this its works fine.
but when i click some button ,using Pagin or during postback the new changed value is not displaying.

My code:
in Item data Bound:
 txtQty.Attributes.Add("onFocusout", "return calculate('" + txtQty.ClientID + "','" + txtamnt.ClientID + "','" + txttotamnt.ClientID + "'," + index + ")");
            txtamnt.Attributes.Add("onFocusout", "return calculate('" + txtQty.ClientID + "','" + txtamnt.ClientID + "','" + txttotamnt.ClientID + "'," + index + ")");
            txttotamnt.Attributes.Add("onfocus", "return calculate('" + txtQty.ClientID + "','" + txtamnt.ClientID + "','" + txttotamnt.ClientID + "'," + index + ")");


and my javascript.
 function calculate(cntl1, cntl2, cntl3,rowindex)
           {
                var text1 =$find(cntl1);
                var text2 =$find(cntl2);
                var text3 = $find(cntl3);
               // alert(rowindex);
                var total = text1.get_value() * text2.get_value();
                text3.set_value(total);
                radGrid.MasterTableView.get_dataItems()[rowindex].get_cell("displayAmnt").innerHTML = total;
            }

how to achive textbox Value change value using client side and presist the value.
Angel Petrov
Telerik team
 answered on 15 Oct 2013
3 answers
478 views
Hi,
I'm trying to set ColumnEditorID to GridNumericColumnEditor in radgrid (pop up edit mode).
So:
 <telerik:GridBoundColumn DataField="TRNO_ID" DataType="System.Decimal" HeaderText="ID"
 ColumnEditorID="TRNO_ID_CE">   
</telerik:GridBoundColumn>  


 <telerik:GridNumericColumnEditor ID="TRNO_ID_CE" NumericTextBox-EnabledStyle-HorizontalAlign="Right" 
                                    runat="server" NumericTextBox-Width="75px"
                                    <NumericTextBox ID="NumericTextBox1" runat="server"
                                        <NumberFormat DecimalDigits="2" /> 
                                    </NumericTextBox> 
</telerik:GridNumericColumnEditor> 
But in edit mode this field is displaying like normal textbox.
But when I set:
<telerik:GridTextBoxColumnEditor ID="TRNO_ID_CE" runat="server"
                                    <TextBoxStyle BackColor="#edffc3" BorderColor="#ecbb0d" BorderStyle="Solid" ForeColor="#7fa822" /> 
</telerik:GridTextBoxColumnEditor> 
in edit mode this field has changed background (it's work).
Where is a problem?
Radoslav
Telerik team
 answered on 15 Oct 2013
1 answer
108 views
I have taken many radComboBoxes with treeViews inside of them and converted them to the RadDropDownTree.  On all the previous ones the onEntryAdded has triggered but on only one of them it is not why could this be?  Here is the one that is broken.

<telerik:RadDropDownTree
    ID="personalCriteriaDropDownTree"
    runat="server"
    AutoPostBack="True"
    DefaultMessage="Enterprise"
    DataFieldID="ID"
    DataFieldParentID="ParentID"
    DataTextField="Name"
    DataValueField="TYPE"
    DropDownSettings-AutoWidth="Disabled"
    DropDownSettings-Height="400px"
    ExpandNodeOnSingleClick="True"
    FullPathDelimiter=" > "
    OnClientEntryAdding="onProgramDropDownClientEntryAdding"
    OnClientEntryAdded="persNodeClicking"
    OnClientEntryRemoved="onProgramDropDownClientEntryRemoved"
    OnClientDropDownClosed="persNodeClosing"
    OnEntryAdded ="ProgramDropDownTree_EntryAdded"
    OnNodeDataBound="PersonalCriteriaDownTree_NodeDataBound"
    TextMode="FullPath"
    Width="300px">
    <HeaderTemplate>
        <div class="header">
            <span style="color: red">* Words in Bold are selectable                                       
            </span>
        </div>
    </HeaderTemplate>
    <FooterTemplate>
        <div class="footer">
            <span style="color: red">* Words in Bold are selectable
 
            </span>
        </div>
    </FooterTemplate>
</telerik:RadDropDownTree>
Shinu
Top achievements
Rank 2
 answered on 15 Oct 2013
6 answers
105 views
i have 2 listbox with the transfer option and i'm showing they're results on a radgrid selectedindex changed but this items of listbox are loaded in code behind but because of the listbox's are inside a radajaxpanel it dont show any data in the radlistbox i take out the radupdatepanel and items are showed, so why with that they are not showing ... since the are loaded from the datatable i checked before with breakpoint 
Bozhidar
Telerik team
 answered on 15 Oct 2013
2 answers
114 views
Hi

I have RadGrid with DetailTables. I am exporting records in Excel.

I have used ExcelML format. It's working fine but I want the DetailTable with different background color. I also want to apply Header color to MasterTableView. But It's not working as I have used ExcelML format.

Is there any solution.?

Thanks
Kamini
Kostadin
Telerik team
 answered on 15 Oct 2013
4 answers
538 views
The function is returning no items. Following is a copy of my markup and code:

protected void Page_Load(object sender, EventArgs e)
{
    RadGrid1.DataSource = GetDataSource();
    RadGrid1.DataBind();
}
 
private DataTable GetDataSource()
{
    ...
}
 
private void AddGroupHeadersToGrid()
{
    GridItem[] header = RadGrid1.MasterTableView.GetItems(GridItemType.Header);
    //GridTHead head = ((GridTHead)header[0].Parent.Controls[0].Parent);
 
    GridHeaderItem newHeaderItem = new GridHeaderItem(RadGrid1.MasterTableView, 0, 0);
    newHeaderItem.Cells.Add(new GridTableHeaderCell());
    newHeaderItem.Cells[0].Text = "I'm a header.";
 
    //head.Controls.AddAt(0, newHeaderItem);
}
protected void RadGrid1_PreRender(object sender, EventArgs e)
{
    AddGroupHeadersToGrid();
}

The markup looks like this:
<telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="false"
    onprerender="RadGrid1_PreRender">
    <MasterTableView>
        <Columns>
            <telerik:GridBoundColumn HeaderText="Question" DataField="Question" UniqueName="Question">
            </telerik:GridBoundColumn>
             
            <telerik:GridBoundColumn HeaderText="Score" DataField="MTDScore" UniqueName="MTDScore">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn HeaderText="Area" DataField="MTDArea" UniqueName="MTDArea">
             
            <telerik:GridBoundColumn HeaderText="Score" DataField="QTDScore" UniqueName="QTDScore">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn HeaderText="Area" DataField="QTDArea" UniqueName="QTDArea">
             
            <telerik:GridBoundColumn HeaderText="Score" DataField="YTDScore" UniqueName="YTDScore">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn HeaderText="Area" DataField="YTDArea" UniqueName="YTDArea">
        </Columns>
    </MasterTableView>
</telerik:RadGrid>

I would really appreciate if somebody can tell me what I'm doing wrong here!
Princy
Top achievements
Rank 2
 answered on 15 Oct 2013
10 answers
376 views
Hi,

I am trying to reference a radTextBox through javascript to capitalize its value on blur and keypress event.
However, $find(client-Side-Object-Name) returns null in IE whereas it works fine in firefox (3.5.5).

The version of our telerik is 2008.3.1314.35

<telerik:RadScriptBlock ID="radScriptBlock" runat="server"
    <script type="text/javascript"
 
        AddPageLoadHandler(function() 
        { 
            AutoCapitaliseFirstChar('<%= FirstNameTextBox.ClientID %>'); 
        }); 
         
    </script> 
    </telerik:RadScriptBlock> 
function AddPageLoadHandler(fn) 
    Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(fn); 
// not created dynamically 
<telerik:RadTextBox runat="server" ID="FirstNameTextBox" /> 
// These client-side functions auto-capitalises text in RadTextBox as user enters it 
// The conversion is done after a short timeout to avoid interfering with normal onfocus behaviour 
function AutoCapitaliseFirstChar(radTextBoxClientId) { 
 
    var radTextBoxClientObject = $find(radTextBoxClientId); 
    // here radTextBoxClientObject is null for IE but not for firefox 
    // so it works fine with firefox not with IE 8 
 
    // This converts the text when field loses focus 
    $(radTextBoxClientObject.get_element()).blur(function() { 
        setTimeout(function() { 
            var val = radTextBoxClientObject.get_value(); 
            radTextBoxClientObject.set_value(val.substring(0, 1).toUpperCase() + val.substring(1)) 
        }, 200); 
    }); 
 
    // Except in Safari, convert the text as it is typed 
    // (in Safari this is incompatible with the field autocomplete behaviour) 
    if (!$.browser.safari) { 
        $(radTextBoxClientObject._textBoxElement).keypress(function() { 
            setTimeout(function() { 
                var val = $(radTextBoxClientObject._textBoxElement).val(); 
                radTextBoxClientObject.set_value(val.substring(0, 1).toUpperCase() + val.substring(1)) 
            }, 200); 
        }); 
    } 
Any ideas would be appreciated,

regards,

Toby


Ganesh
Top achievements
Rank 1
 answered on 15 Oct 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
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?