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

Looking to disable the select all check box in the grid header. Limitiing users to a certain number of selected rows.. Im only using client side functonality. no server code, any suggestions?

Thanks

Bobby
Top achievements
Rank 1
 answered on 14 Jan 2009
3 answers
91 views
Hi,
 I am finally making great progress with your tools. I have however hit a little bump in the rode. I created a grid with a context menu per your sample code and everythign worked great. The next step was to actually create a tabstrip and have a radgrid on each tab view. No problem, I changed the aspx pages hosting the grid to ascx pages and linked them to the tabstrip view. Everything worked well with the exception of the contextmenu and the editform popup. The javascript is looking for the radgrid which is no longer onthe page but in the control page. Are there any examples of how to pass the grid information to host page for the control? I believe this is what is causing the problem
johnathan
Top achievements
Rank 1
 answered on 14 Jan 2009
0 answers
84 views
I have a RadTreeview and i change some of its nodes attributes in client-mode: how can i add the node modified to the collection clientChanges so i  can retrieve this modifications on server side?

Thanks.

P.S.: ClientChanges works well (add the node to its collection) if i drag&drog a node by client-side, if i rename a node always client-side but not if i only change a node attribute in client-side.
laplace82
Top achievements
Rank 1
 asked on 14 Jan 2009
3 answers
245 views
Hello there, 

I have a radCombobox that holds phone types.  (business, cell, home etc)  When someone selects a type, it loads that phone number in a text box.  However, some types are blank, and some types hold a value.  I want to modify the css style of just the items that actually hold a value.

I have my combo box loading from a custom CSS sheet succesfully. 

When I modify these two classes in the CSS file, the changes are reflected in the drop down correctly.  However, I need to be able to change the styles from code behind.
.RadComboBoxDropDown_Outlook .rcbItem,  
.RadComboBoxDropDown_Outlook .rcbHovered,  
.RadComboBoxDropDown_Outlook .rcbDisabled,  
.RadComboBoxDropDown_Outlook .rcbLoading  
{  
    padding:1px 20px 1px 4px;  
}  
.RadComboBoxDropDown_Outlook .rcbHovered  
{  
    background:#306ac5;  
    color:#fff;  
I want to change the style when the item has value to something like this:
.RadComboBoxDropDown_Outlook2 .rcbItem,  
.RadComboBoxDropDown_Outlook2 .rcbHovered,  
.RadComboBoxDropDown_Outlook2 .rcbDisabled,  
.RadComboBoxDropDown_Outlook2 .rcbLoading  
{  
    padding:1px 4px 1px 20px;  
    color: Red;  
}  
.RadComboBoxDropDown_Outlook2 .rcbHovered  
{  
    background:red;  
    color:#fff;  

Here is where I tried to change the item in code behind but and was unsuccessful:
Dim typeArray() As Integer = .GetAllPhoneTypesAvailable()  
 
            For k As Integer = 0 To typeArray.Length - 1  
                rcbPhones.FindItemByValue(typeArray(k)).CssClass = "RadComboBoxDropDown_Outlook2" 
            Next 


any help is appreciated.

Coty
Yana
Telerik team
 answered on 14 Jan 2009
2 answers
296 views
Hi
I am trying to delete the Complete group from Radgrid.Below is the code i am trying to use

<rad:RadGrid ID="Subsec_grid" Visible="False" Font-Size="X-Large" OnNeedDataSource="Subsec_grid_NeedDataSource" runat="server" EnableAJAX="True" EnableAJAXLoadingTemplate="True"  Skin="WebBlue"  GridLines="None" Width="335px" > 
       <MasterTableView AutoGenerateColumns="False" Width="100%" DataKeyNames="Message,id"  > 
        
 
       <Columns> 
      <rad:GridBoundColumn UniqueName="name" SortExpression="name" ItemStyle-Font-Size="Medium" Groupable="False"  HeaderText="name" DataField="name" > 
                    </rad:GridBoundColumn> 
                     
                    <rad:GridBoundColumn DataField="Message" ItemStyle-Font-Size="Medium" Groupable="False"  UniqueName="Message"  SortExpression="Message"  HeaderText="Message" > 
                    </rad:GridBoundColumn> 
                        <rad:GridTemplateColumn UniqueName="delete" AllowFiltering="False"   > 
                    <ItemTemplate> 
                    <asp:button  ID="del_lnk" runat="server" Text="Inactivate" OnClick="Delete_Section"  /> 
                      
                    </ItemTemplate> 
                        <ItemStyle HorizontalAlign="Left" /> 
                    </rad:GridTemplateColumn> 
                                      
<rad:GridBoundColumn DataField="id" UniqueName="id" Visible="false"></rad:GridBoundColumn> 
                      
                      
       </Columns> 
       
        <GroupByExpressions >   
         
           
                                                <rad:GridGroupByExpression > 
                                                    
                                                    <SelectFields >    
                                                        <rad:GridGroupByField  FieldAlias="no" FieldName="no" HeaderText="Number" />    
                                                          
                                                    </SelectFields>    
                                                    <GroupByFields>   
                                                       
                                                        <rad:GridGroupByField FieldAlias="no" FieldName="no"  HeaderText="Number"  />    
                                                    </GroupByFields>    
                                                </rad:GridGroupByExpression>    
                                            </GroupByExpressions>    
 
           <RowIndicatorColumn Visible="False">  
               <HeaderStyle Width="20px" /> 
           </RowIndicatorColumn> 
           <ExpandCollapseColumn Resizable="False" Visible="False">  
               <HeaderStyle Width="20px" /> 
           </ExpandCollapseColumn> 
           
       </MasterTableView> 
       <ClientSettings EnablePostBackOnRowClick="true"></ClientSettings> 
       </rad:RadGrid> 
When view this i see inactivate button for each and every row.Is there a way i can show that button only for Groupfield which is bside Number.

I know ican use detailtable/ParentTableRelation is there any other simple way i can just add delete button to Groupfield

Thanks
Kavya
Kavya
Top achievements
Rank 2
 answered on 14 Jan 2009
5 answers
444 views
Hi,
I have one odd problem!
If I add a RadScriptManager on the page all client side validation stop working.
What have I missed?

Testcode:
%@ Page Language="C#" AutoEventWireup="true" CodeBehind="test.aspx.cs" Inherits="App.Web.UI.Administration.Secure.test" %> 
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
 
<html xmlns="http://www.w3.org/1999/xhtml" > 
<head runat="server"
    <title></title
</head> 
<body> 
    <form id="form1" runat="server"
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server"
    </telerik:RadScriptManager> 
    <div> 
         <table class="form"
            <tr> 
                <td class="red">Namn:</td> 
                <td><asp:TextBox ID="textBoxName" runat="server" CssClass="xLarge" ValidationGroup="validationGroupBanner"></asp:TextBox> 
                    <asp:RequiredFieldValidator ID="requiredFieldValidatorName" runat="server"  
                        ControlToValidate="textBoxName" Display="Dynamic" ErrorMessage="obligatorisk"  
                        SetFocusOnError="True" ValidationGroup="validationGroupBanner"></asp:RequiredFieldValidator> 
                </td> 
            </tr> 
        </table> 
    </div> 
    </form> 
</body> 
</html> 

Result:
 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
 
<html xmlns="http://www.w3.org/1999/xhtml" > 
<head><title
 
</title></head
<body> 
    <form name="form1" method="post" action="test.aspx" onsubmit="javascript:return WebForm_OnSubmit();" id="form1"
<div> 
<input type="hidden" name="RadScriptManager1_HiddenField" id="RadScriptManager1_HiddenField" value="" /> 
<input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" /> 
<input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" /> 
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUKLTM2MDkyOTg3MGRkKKxwM9OSYlk1EpTM5Wl6MC4iboc=" /> 
</div> 
 
<script type="text/javascript"
//<![CDATA[
var theForm = document.forms['form1'];
if (!theForm) {
    theForm = document.form1;
}
function __doPostBack(eventTarget, eventArgument) {
    if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
        theForm.__EVENTTARGET.value = eventTarget;
        theForm.__EVENTARGUMENT.value = eventArgument;
        theForm.submit();
    }
}
//]]> 
</script> 
 
 
<script src="/WebResource.axd?d=PJbs5I8u7UnXghzYecrYew2&amp;t=633527857956801634" type="text/javascript"></script> 
 
 
<script src="/ScriptResource.axd?d=7ZfBM6SkJ6AkD6NPKf2D84lP3jDRYRutI_sNsAMiNpP9Ndvl6rKJDioozY5LQgGdlUnZK2zCZizinGUlzrFvQA2&amp;t=633527857956801634" type="text/javascript"></script> 
<script src="/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=RadScriptManager1_HiddenField&amp;compress=1&amp;_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d1.0.61025.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3aen-US%3a1f0f78f9-0731-4ae9-b308-56936732ccb8%3a52817a7d%3a67c678a8" type="text/javascript"></script> 
<script type="text/javascript"
//<![CDATA[
function WebForm_OnSubmit() {
if (typeof(ValidatorOnSubmit) == "function" && ValidatorOnSubmit() == false) return false;
return true;
}
//]]> 
</script> 
 
<div> 
 
    <input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEWAgLcrOGFAgKPlYESheV+n5Sp2a2I8UvaK2DAJ589lhU=" /> 
</div> 
    <script type="text/javascript"
//<![CDATA[
Sys.WebForms.PageRequestManager._initialize('RadScriptManager1', document.getElementById('form1'));
Sys.WebForms.PageRequestManager.getInstance()._updateControls([], [], [], 90);
//]]> 
</script> 
 
    <div> 
         <table class="form"
                   
                        <tr> 
                            <td class="red">Namn:</td> 
                            <td><input name="textBoxName" type="text" id="textBoxName" class="xLarge" /> 
                                <span id="requiredFieldValidatorName" style="color:Red;display:none;">obligatorisk</span> 
                            </td> 
                        </tr> 
              
                    </table> 
    </div> 
     
<script type="text/javascript"
//<![CDATA[
var Page_Validators =  new Array(document.getElementById("requiredFieldValidatorName"));
//]]> 
</script> 
 
<script type="text/javascript"
//<![CDATA[
var requiredFieldValidatorName = document.all ? document.all["requiredFieldValidatorName"] : document.getElementById("requiredFieldValidatorName");
requiredFieldValidatorName.controltovalidate = "textBoxName";
requiredFieldValidatorName.focusOnError = "t";
requiredFieldValidatorName.errormessage = "obligatorisk";
requiredFieldValidatorName.display = "Dynamic";
requiredFieldValidatorName.validationGroup = "validationGroupBanner";
requiredFieldValidatorName.evaluationfunction = "RequiredFieldValidatorEvaluateIsValid";
requiredFieldValidatorName.initialvalue = "";
//]]> 
</script> 
 
 
<script type="text/javascript"
//<![CDATA[
var Page_ValidationActive = false;
if (typeof(ValidatorOnLoad) == "function") {
    ValidatorOnLoad();
}
function ValidatorOnSubmit() {
    if (Page_ValidationActive) {
        return ValidatorCommonOnSubmit();
    }
    else {
        return true;
    }
}
        Sys.Application.initialize();
document.getElementById('requiredFieldValidatorName').dispose = function() {
    Array.remove(Page_Validators, document.getElementById('requiredFieldValidatorName'));
}
//]]> 
</script> 
</form> 
</body> 
</html> 
 

Result without scriptmanager, now the validator works:
 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
 
<html xmlns="http://www.w3.org/1999/xhtml" > 
<head><title
 
</title></head
<body> 
    <form name="form1" method="post" action="test.aspx" onsubmit="javascript:return WebForm_OnSubmit();" id="form1"
<div> 
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUJNjE1MzQwNzgzZGQUXdcWlpAsgxQEdMt/9c9OtbGOYg==" /> 
</div> 
 
 
<script src="/WebResource.axd?d=S67xmpnCynrpCGuTG1uCu5qbsb48xm5XkXRTyH8bt181&amp;t=633527857956801634" type="text/javascript"></script> 
<script type="text/javascript"
//<![CDATA[
function WebForm_OnSubmit() {
if (typeof(ValidatorOnSubmit) == "function" && ValidatorOnSubmit() == false) return false;
return true;
}
//]]> 
</script> 
 
<div> 
 
    <input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEWAgKYhNfGBgKPlYESviUaHFwOJ+saekYypJvt3mDGaP4=" /> 
</div> 
    
    <div> 
         <table class="form"
                   
                        <tr> 
                            <td class="red">Namn:</td> 
                            <td><input name="textBoxName" type="text" id="textBoxName" class="xLarge" /> 
                                <span id="requiredFieldValidatorName" style="color:Red;display:none;">obligatorisk</span> 
                            </td> 
                        </tr> 
              
                    </table> 
    </div> 
     
<script type="text/javascript"
//<![CDATA[
var Page_Validators =  new Array(document.getElementById("requiredFieldValidatorName"));
//]]> 
</script> 
 
<script type="text/javascript"
//<![CDATA[
var requiredFieldValidatorName = document.all ? document.all["requiredFieldValidatorName"] : document.getElementById("requiredFieldValidatorName");
requiredFieldValidatorName.controltovalidate = "textBoxName";
requiredFieldValidatorName.focusOnError = "t";
requiredFieldValidatorName.errormessage = "obligatorisk";
requiredFieldValidatorName.display = "Dynamic";
requiredFieldValidatorName.validationGroup = "validationGroupBanner";
requiredFieldValidatorName.evaluationfunction = "RequiredFieldValidatorEvaluateIsValid";
requiredFieldValidatorName.initialvalue = "";
//]]> 
</script> 
 
 
<script type="text/javascript"
//<![CDATA[
var Page_ValidationActive = false;
if (typeof(ValidatorOnLoad) == "function") {
    ValidatorOnLoad();
}
function ValidatorOnSubmit() {
    if (Page_ValidationActive) {
        return ValidatorCommonOnSubmit();
    }
    else {
        return true;
    }
}
        //]]> 
</script> 
</form> 
</body> 
</html> 
 

Mattias
Top achievements
Rank 1
 answered on 14 Jan 2009
6 answers
193 views
how to adjust the column size to be the length of the data from the database. i can only set headerstyle.width= to certain width but not automatically to the length of the data. thanks.
appdev
Top achievements
Rank 1
 answered on 14 Jan 2009
1 answer
130 views
Hi,

For some reason the RadAjaxLoadingPanel is only displayed once when using any control in a webpart. I'm doing pretty much the same as http://demos.telerik.com/aspnet-ajax/Ajax/Examples/Common/AjaxifyTimer/DefaultCS.aspx and although the content in the grid updates ever tick the loading panel is only displayed once (the very first time).

Any suggestions?

Thanks!
mitch

Nikolay Raykov
Telerik team
 answered on 14 Jan 2009
1 answer
136 views
Hi

i have a radmasktextbox for tax .

while inserting i need to insert 10 numbers for tax in database . but while fetch and view mode i need to encrypt first 7 numbers and show only last three numbers.

i m able to encrypt but while showing in text textboxid.text  is throwing NULL

Result should look like xxxxxxx123
The following code i used
private string MaskText(string strMasktext, int DisplayCount) 
 
        { 
            int temp = strMasktext.Length - DisplayCount; 
            string LastChar = strMasktext.Substring(temp, DisplayCount); 
            string MaskVal = string.Empty; 
            for (int l_intCnt = 0; l_intCnt < temp; l_intCnt++) 
            { 
                MaskValMaskVal = MaskVal + 0; 
            } 
            return MaskValMaskVal = MaskVal + LastChar; 
        } 
 
 
string taxid = string.Empty; 
txtmaskTaxid.Enabled = true
taxid = MaskText(dsESIIDSearch.Tables[0].Rows[0]["TaxID"].ToString(), 3); 
txtmaskTaxid.Text = taxid
 
 

Iana Tsolova
Telerik team
 answered on 14 Jan 2009
3 answers
155 views
I noticed several things when specifying SEO paging. In the ItemDataBound event, the ItemIndex does not correspond to the DataKeyValues. DataKeyValues always start with the first record of your datasource. The CurrentPageIndex is always 0. I'm not sure if this is a bug or something i am not doing correctly.

As a work around i had to write this code to get the datakey:

           int currepagepageindex = 1;
            int itemindex = 0;

            if (Request.QueryString[GrdProducts.ClientID + "ChangePage"] != null)
                currepagepageindex = int.Parse(Request.QueryString[GrdProducts.ClientID + "ChangePage"]);
            
            
            itemindex = currepagepageindex * GrdProducts.PageSize - GrdProducts.PageSize + e.Item.ItemIndex;
            if (itemindex < ((DataTable)GrdProducts.DataSource).Rows.Count)
            {
                inventoryid = (int)((DataTable)GrdProducts.DataSource).Rows[itemindex]["inventoryid"];
            }
                      




Howard Etheridge
Top achievements
Rank 1
 answered on 14 Jan 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?