Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
85 views
We are using a user control for editing in our RadGrid.  Whenever the edit link is clicked, it appears the grid goes back to the datasource and pulls all of the items and then filters to list to the edit item.

For us recreating that entire list can sometimes be a costly, multiple hits to the DB for security privilege checking, validations as to whether an item can be deleted, etc. This is especially painful when its simply going to be filtered down to one item.  Is there any event, etc. where I could step in and just provide the single item that is needed?  The datakey is set on the grid so I could look up just the single (entity in this case) that is needed.

Thanks,

Matt
Tsvetoslav
Telerik team
 answered on 25 Jun 2010
1 answer
92 views
Hello Friends,

Iam working with Rad Grid. Here when I am trying to update a row I could select the checkbox and then I could get the values in dropdown and textbox. But when I click on update I could not get the id of that dropdown or text box. Please guide me in this issue.
Thanks in advance

Sunil
Princy
Top achievements
Rank 2
 answered on 25 Jun 2010
3 answers
205 views
Hi, i'am using EntityDataSource in RadGrid. Grid generates "[Some nullable field] = (CAST(NULL AS varchar(1))" sql code for compare to null value in filtter("IsNull", "NotIsNull" with <> condition). This sql code is wrong and return invalid result. How i can use "IsNull", "NotIsNull" filter expressions?
Tsvetoslav
Telerik team
 answered on 25 Jun 2010
1 answer
152 views
Is there a way to allow the user to select a range of dates. I basically have a multi-month calendar (3 months side by side), and I want the user to be able to click a date on one and then another date on another and have it select all the dates in between. Kind of like how the Google Analytics calendar works. Are there any plans to add this type of control or can this be achieved with the current calendar control. If the user clicks on the third date it would need to clear the current dates selected, etc.

Thanks in advance!
Shinu
Top achievements
Rank 2
 answered on 25 Jun 2010
1 answer
202 views
Hello,

I tried to add a griddatetimecolum in my grid and the display is really bad in chrome as you can see in attachment files. 
At first the griddatetimecolumn is very large and the refresh button is in a strange position.

Is it a way to see it the same way as internet explorer or firefox?

My aspx page contains this description for the grid:

<telerik:RadGrid ID="mGrdEvent" runat="server" GridLines="None" AllowPaging="True"
    AllowSorting="True" AutoGenerateColumns="False" ShowStatusBar="True" 
     AllowFilteringByColumn="True" ...
    >
   
    <MasterTableView  CommandItemDisplay="Top" DataKeyNames="Identifier"
        AllowFilteringByColumn="true" AllowAutomaticInserts="False">
        <Columns>

 ...               
      <telerik:GridDateTimeColumn UniqueName="CreationDate" DataField="CreationDate"  
                     PickerType="DateTimePicker" HeaderText="Creation date" DataFormatString="{0}">
          <ItemStyle Width="120px" />
            </telerik:GridDateTimeColumn>
        </Columns>
...
    </MasterTableView>

</telerik:RadGrid>



Tsvetoslav
Telerik team
 answered on 25 Jun 2010
1 answer
105 views
Hi, I'm having a problem with Server Validation controls that prohibit the ItemCommand CancelAll to work because some controls need some value when a new item is created. How can I disable validation when the user decides not to create the new item (and did not fill in all of those validated controls)?

Thanks in advance for any help!
Pieter
Tsvetoslav
Telerik team
 answered on 25 Jun 2010
4 answers
132 views
I am returning Customer Values using RadWindows. When I retrieve the customer infro from the RadWindow I want to make 'pnlCustomerInfoCustomerData' (panel) visible. I have been trying to do this within the "function clientClose", but not sure how to do this. I am using the ASPNET Ajax 2010 tool, any ideas would be great. The code I am using is posted below:

<telerik:radscriptblock runat="server" ID="radScriptBlock">  
        <script type="text/javascript">  
            function openCustomerLookupWindow()  
            {                    
                var txtNo = $find("<%= txtExistingCustomerSearchCustomerNo.ClientID %>");    
                var txtCoNam = $find("<%= txtExistingCustomerSearchCompanyName.ClientID %>");    
                var txtCPN = $find("<%= txtExistingCustomerSearchContactPerson.ClientID %>");    
                var txtCity = $find("<%= txtExistingCustomerSearchCity.ClientID %>");    
                var cboState = $find("<%= cboExistingCustomerSearchState.ClientID %>");    
                var oWnd = window.radopen('../../Lookups/NavCustomerLookup.aspx?navco=<%=session("SP_SearchCustomerNavCompany")%>&no=' + txtNo.get_value() + '&conam=' + txtCoNam.get_value() + '&cpn=' + txtCPN.get_value() + '&city=' + txtCity.get_value() + '&state=' + cboState.get_value() + '',"winCustomerLookup");  
                //oWnd.argument = combo.get_value();   
                oWnd.Center();  
                //oWnd.SetSize(800,500);  
            }  
              
            function clientShow(sender, eventArgs)  
            {  
                //var txtDate = $find("<%= txtExistingCustomerSearchCustomerNo.ClientID %>");    
                //sender.argument = txtDate.get_value;    
                //sender.argument = document.getElementById('<%=txtExistingCustomerSearchCustomerNo.ClientID%>').innerText;   
            }  
 
            function clientClose(oWnd,args)  
            {  
                var txtNo = $find("<%= txtExistingCustomerSearchCustomerNo.ClientID %>");    
                var txtCoNam = $find("<%= txtExistingCustomerSearchCompanyName.ClientID %>");    
                var txtCPN = $find("<%= txtExistingCustomerSearchContactPerson.ClientID %>");    
                var txtCity = $find("<%= txtExistingCustomerSearchCity.ClientID %>");    
                var cboState = $find("<%= cboExistingCustomerSearchState.ClientID %>");    
                //get the transferred arguments  
                var arg = args.get_argument();  
                if(arg)  
                {   
                    var CustomerNo = arg.CustomerNo;  
                    var CompanyName = arg.CompanyName;  
                    var ContactPersonName = arg.ContactPersonName;  
                    var CustomerCity = arg.CustomerCity;  
                    var CustomerState = arg.CustomerState;  
                      
                    txtNo.set_value(CustomerNo);  
                    txtCoNam.set_value(CompanyName);  
                    txtCPN.set_value(ContactPersonName);  
                    txtCity.set_value(CustomerCity);  
                    cboState.set_value(CustomerState);  
                    document.getElementById('pnlCustomerInfoCustomerData').style.display = 'none';            
                }  
                document.forms[0].submit();  
            }  
              
              
        </script>  
    </telerik:radscriptblock>  

This is my panel:
<telerik:radajaxpanel runat="server" LoadingPanelID="LoadingPanel" ID="AjaxPanel" Wrap="False" EnableAJAX="False">  
<asp:Panel ID="pnlCustomerInfoCustomerData" runat="server">  
</asp:Panel>  
</telerik:RadAjaxPanel> 
Georgi Tunev
Telerik team
 answered on 25 Jun 2010
2 answers
171 views
I currently have a RadGrid with an EditItemTemplate that contains, among other things, a checkbox, a RadTextBox and a RequiredFieldValidator.  If the checkbox is checked, then the RadTextBox is a required field.  If it is unchecked, then the RadTextBox can be empty.  This works perfectly when you edit a record.  When you insert a new record, however, the validator stops the form from submitting, but the message ("Email is a required field') does not appear.  Anyone have any suggestions?  My code is below:

RadGrid:
            <telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" AllowSorting="True" 
              AutoGenerateColumns="False" GridLines="None" AutoGenerateDeleteColumn="False" 
              AutoGenerateEditColumn="False" Width="100%" Skin="Office2007"> 
              <AlternatingItemStyle BackColor="#EAF2FF" /> 
              <MasterTableView CommandItemDisplay="Top" DataKeyNames="BranchID" OverrideDataSourceControlSorting="true"> 
                <RowIndicatorColumn> 
                  <HeaderStyle Width="20px"></HeaderStyle> 
                </RowIndicatorColumn> 
                <ExpandCollapseColumn> 
                  <HeaderStyle Width="20px"></HeaderStyle> 
                </ExpandCollapseColumn> 
                <CommandItemSettings AddNewRecordText="Add new Branch" /> 
                <Columns> 
                  <telerik:GridTemplateColumn DataField="NotifyFlag" HeaderText="Notify?" SortExpression="NotifyFlag" 
                    UniqueName="NotifyFlag" Visible="False"> 
                    <EditItemTemplate> 
                      <asp:CheckBox runat="server" ID="cbNotify" Checked='<%#convertBool(DataBinder.Eval(Container.DataItem, "Notifyflag"))%>' /> 
                    </EditItemTemplate> 
                    <ItemStyle HorizontalAlign="Left" /> 
                  </telerik:GridTemplateColumn> 
                  <telerik:GridTemplateColumn DataField="Email" HeaderText="Email" SortExpression="Email" 
                    UniqueName="Email" Visible="false"> 
                    <ItemTemplate> 
                      <%#DataBinder.Eval(Container.DataItem, "Email")%> 
                    </ItemTemplate> 
                    <EditItemTemplate> 
                      <telerik:RadTextBox runat="server" ID="txtEmail" Width="280px" Text='<%#DataBinder.Eval(Container.DataItem, "Email")%>' /> 
                      <asp:RequiredFieldValidator runat="server" ID="rfvEmail" ControlToValidate="txtEmail"  
                        Display="Dynamic" ErrorMessage="Email address required" Enabled="false"></asp:RequiredFieldValidator> 
                      <asp:RegularExpressionValidator runat="server" ID="revEmail" Display="Dynamic" ControlToValidate="txtEmail"  
                        ErrorMessage="Valid email required" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" /> 
                    </EditItemTemplate> 
                    <ItemStyle HorizontalAlign="Left" /> 
                  </telerik:GridTemplateColumn> 
                  <telerik:GridButtonColumn ButtonType="LinkButton" CommandName="Edit" Text="Edit" 
                    UniqueName="EditColumn"> 
                    <ItemStyle HorizontalAlign="Center" /> 
                  </telerik:GridButtonColumn> 
                  <telerik:GridButtonColumn ButtonType="LinkButton" CommandName="Delete" Text="Delete" 
                    ConfirmDialogType="RadWindow" ConfirmText="Are you sure you want to delete this Branch?" /> 
                </Columns> 
                <EditFormSettings ColumnNumber="1" CaptionFormatString="" FormTableItemStyle-HorizontalAlign="Left"  
          FormTableAlternatingItemStyle-HorizontalAlign="Left"> 
                  <EditColumn ButtonType="PushButton" CancelText=" Cancel" UpdateText=" Save" 
                    InsertText=" Save" UniqueName="EditCommandColumn1"> 
                  </EditColumn> 
                  <FormMainTableStyle CellPadding="3" CellSpacing="0" BackColor="White"></FormMainTableStyle> 
                  <FormCaptionStyle></FormCaptionStyle> 
                  <FormTableItemStyle Wrap="False"></FormTableItemStyle> 
                  <FormTableAlternatingItemStyle Wrap="False"></FormTableAlternatingItemStyle> 
                  <FormTableButtonRowStyle HorizontalAlign="Right"></FormTableButtonRowStyle> 
                </EditFormSettings> 
              </MasterTableView> 
            </telerik:RadGrid> 
 


Javascript:
  <script type="text/javascript"> 
 
    function emailChanged(obj) { 
      if (obj.checked != true) { 
        var hiddenBox = document.getElementById("hdnRFV"); 
        var theRFV = document.getElementById(hiddenBox.value); 
        alert("Here1: " + hiddenBox.value); 
        ValidatorEnable(theRFV, false); 
      } else { 
        var hiddenBox = document.getElementById("hdnRFV"); 
        var theRFV = document.getElementById(hiddenBox.value); 
        alert("Here1: " + hiddenBox.value); 
        ValidatorEnable(theRFV, true); 
      } 
    }  
 
  </script> 


The Code-Behind:
    Protected Sub RadGrid1_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid1.ItemDataBound 
        ' sets the status of the validator based on the value of the NotifyFlag column 
        If (TypeOf e.Item Is GridEditableItem) AndAlso (e.Item.IsInEditMode) Then 
            Dim edititem As GridEditableItem = DirectCast(e.Item, GridEditableItem) 
            Dim myCheckBox As CheckBox = DirectCast(edititem("NotifyFlag").Controls(1), CheckBox) 
            myCheckBox.Attributes.Add("onclick", "emailChanged(this);") 
 
            Dim cntrl As HiddenField = DirectCast(FindControl("hdnRFV"), HiddenField) 
            cntrl.Value = DirectCast(edititem("Email").Controls(3), RequiredFieldValidator).ClientID 
        End If 
    End Subhelp


Thanks in advance for any helpl!

Marc



Marc Lee
Top achievements
Rank 2
 answered on 24 Jun 2010
2 answers
165 views
I am using RadGrid version 2009.3.1208.35. All code is below.

When I set the Date column as DataType="System.DateTime" it still does not seem to sort correctly. If i set the Column type to DateTime, ie "dt.Columns.Add("Date", typeof(DateTime));" it works. Is there any way to have correct sorting without having to do this?



    protected void gv_NeedDataSource(object source, GridNeedDataSourceEventArgs e) 
    { 
      DataTable dt = new DataTable(); 
      dt.Columns.Add("Date"); 
      dt.Columns.Add("Double"); 
      dt.Rows.Add(new object[] {"14/08/2009","1.1" }); 
      dt.Rows.Add(new object[] { "20/08/2009", "10.1" }); 
      dt.Rows.Add(new object[] { "10/09/2009", "2.1" }); 
      dt.Rows.Add(new object[] { "25/09/2008", "2.1" }); 
      dt.Rows.Add(new object[] { "25/11/2009", "2.1" }); 
      dt.Rows.Add(new object[] { "1/1/2009", "2.1" }); 
 
      rg.DataSource = dt; 
    } 


    <telerik:RadGrid ID="rg" runat="server" AutoGenerateColumns="false" OnNeedDataSource="gv_NeedDataSource" 
      AllowSorting="true"> 
      <MasterTableView> 
        <Columns> 
          <telerik:GridBoundColumn DataType="System.DateTime" HeaderText="Date" DataField="Date" 
            UniqueName="Date" DataFormatString="{0:MM/yyyy}"> 
          </telerik:GridBoundColumn> 
          <telerik:GridBoundColumn DataType="System.Double" HeaderText="Double" DataField="Double" 
            ItemStyle-HorizontalAlign="Right"> 
          </telerik:GridBoundColumn> 
        </Columns> 
      </MasterTableView> 
    </telerik:RadGrid> 




whidbey boy
Top achievements
Rank 1
 answered on 24 Jun 2010
1 answer
42 views
Hi Experts,

I was using RadListBox and feels so cool until I test with IE 6.

Unfortunately, If I add the list box control as shown below and view in IE6, the whole page become blank!!!!

But I can see the control if both AllowDelete and  AllowReorder is set to false. But I need those buttons. Can anyone help me to fix.

Thanks alot.


 

<telerik:RadListBox ID="lstOptions" runat="server" AllowDelete="True"

 

 

AllowReorder="True"

 

 

Skin="WebBlue" DataTextField="OptionText" DataValueField="FormattedValue"

 

 

Height="200px" Width="385px" AutoPostBack="False"

 

 

>

 

 

 

<ButtonSettings ReorderButtons="Common"></ButtonSettings>

 

 

 

<EmptyMessageTemplate>

 

 

<span style="color:Red;" > No options added! </span>

 

 

</EmptyMessageTemplate>

 

 

 

</telerik:RadListBox>

 

Genady Sergeev
Telerik team
 answered on 24 Jun 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?