Telerik Forums
UI for ASP.NET AJAX Forum
10 answers
469 views
I want to remove refresh,pin,maximize and minimize buttons from WindowTitle. I am not using Window Manager.I am using ClientSide javascript to invoke that window.here is my javascript that creates window.

function showEmailtoFriendWindow(ImageButton) {
        var oWnd = radopen("EmailToFriend.aspx", "EmailToFriendWin");
        oWnd.SetWidth(220);
        oWnd.SetHeight(200);
        var pos = GetTopLeftPosition(ImageButton);
        oWnd.moveTo(pos.x + parseInt(ImageButton.clientWidth), pos.y);
        oWnd.show();
    }
function GetTopLeftPosition(element) {
        var left = 0;
        var top = 0;

        while (element.offsetParent) {
            left += element.offsetLeft;
            top += element.offsetTop;
            element = element.offsetParent;
        }
        if (element.x) left = element.x;
        if (element.y) top = element.y;
        var oPos = new Object();
        oPos.x = left;
        oPos.y = top;
        return oPos;
    }
from here I want to remove those button through code.Kindly help me in this regard.

Thanks
Georgi Tunev
Telerik team
 answered on 22 Apr 2009
1 answer
142 views
Dear,
I create tempalte colum .It contains just one Literal.I bind Data for Literal in ItemDataBound event .I combind data from 3 field on Database.How I can filter this column?
Below is my code:
HTML:
 <telerik:GridTemplateColumn UniqueName="EmployeeInfo" DataType="System.String" AllowFiltering="true" AutoPostBackOnFilter="true" ItemStyle-HorizontalAlign="center" HeaderText="<%$ Resources:Strings, UR000001grvhEmployeeInfo %>"
                HeaderStyle-HorizontalAlign="Center">
                <ItemTemplate>
                    <table cellpadding="0" border="0px" cellspacing="0" width="100%" style="overflow: hidden">
                        <tr>
                            <td align="center" style="overflow: hidden">
                                <asp:Literal ID="UR009001litEmployeeInfo" runat="server" />
                            </td>
                        </tr>
                    </table>
                </ItemTemplate>
                <HeaderStyle HorizontalAlign="Center" Width="80px"></HeaderStyle>
                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Wrap="true">
                </ItemStyle>
            </telerik:GridTemplateColumn>
ItemDataBoundEvent:
Literal litEmployeeInfo = (Literal)e.Item.Cells[0].FindControl(Constant.UR009001litEmployeeInfo);
 litEmployeeInfo.Text = emp.EmployeeID  + emp.FirstName + emp.SureName;
Princy
Top achievements
Rank 2
 answered on 22 Apr 2009
1 answer
225 views
We have a popup edit and have captured the update event client side to do a validation by way of a confirmation popup.  The issue is that we have a rad date picker in the popup and we cannot seem to figure out how to get the edit value.  Could some post an example of how to do this client side? 

All other mechanics are in place, we just need to know how to access the edit value,  we are capturing the command events by:

 

<ClientEvents OnCommand="RaiseCommand"/>

  

And we need to get our edited values from/in our client side script ....  we already have access to previous values (data values) but do not seem to be able to get the edited values

here is the latest of the test code to try to get this to work ...
 

 

 

 

function RaiseCommand(sender, args)

{

 

//retrieve the current commandName and commandArgument

 

 

 

 

var result = String.format("CommandName: {0}, CommandArgument: {1}", args.get_commandName(), args.get_commandArgument());

 

 

 

if(args.get_commandName() == "Update"){

 

 

 

var grid = sender;

 

 

 

var MasterTable = grid.get_masterTableView();

 

 

 

var row = MasterTable.get_dataItems()[args.get_commandArgument()];

 

 

 

var cell = MasterTable.getCellByColumnUniqueName(row, "EndDate");

 

 

 

var dtStart = new Date("<%=ViewState("StartDate").ToString %>");

 

 

 

var dtCompare = new Date();

 

 

 

var popUp = args.get_popUp();

 

 

 

var pArgs = popUp.arguments;

 

alert(pArgs.EndDate);

 

 

if(cell.innerHTML == "" || cell.innerHTML == "&nbsp;"){

 

 

dtCompare =

"01/01/1800"

 

 

 

else{

 

 

 dtCompare = cell.innerHTML;

}

alert(dtStart);

alert(dtCompare);

  

 

 

var newValues=MasterTable.extractValuesFromItem(args.get_commandArgument());

 

var newValuesSB = new Sys.StringBuilder();

 

 

 

for(var property in newValues)

 

 

{

newValuesSB.append(String.format(

 

 

"<b>{0}</b> : {1} <br/>", property,newValues[property]));

}

alert(newValuesSB);

 

if(dtCompare < dtStart){

 

 

 

// confirm

 

 

 

 

if(!confirm("Setting the End Date as you have will result in this disclosure falling outside of the Annual Review Period. Do you wish to proceed?")) {

 

 

args.set_cancel(

 

 

true);

}

}

 

//alert(result);

 

 

 

 

}

 

 

}

 

 

Many many thanks in advance!

Tsvetoslav
Telerik team
 answered on 22 Apr 2009
1 answer
164 views
Hi All,

Been a little while but I'm doing UI work again, and fixing some bugs.  I am up against a wall on this one.  Essentially, I need to have a dual-validation - if a checkbox is checked <t:GridCheckBoxColumn...> then I need to perform both a regexp validator for e-mail address format and a custom validator to make sure it is not blank if the checkbox is checked.  This occurs in a <t:GridTemplateColumn><EditItemTemplate>

I would first of all like to know if I can get the actual row being edited out of the arguments passed to the validator - it seems not.  If that is not possible, an index to the row being edited will do - where can I get that?  Maybe there is a way to do a FindControl() on a row? Finally, I am willing to iterate all rows if I must and ask "are you being edited?" (assuming that I can.)

I can get the *old* values of the columns using getDataKey(), in my validator JavaScript, but I don't know how to get the new value of the checkbox.checked or the TextBox.value.

Here is the markup for the columns of interest:

<telerik:GridCheckBoxColumn DataField="SendNotification"  
  DataType="System.Boolean"  
  meta:resourcekey="GridCheckBoxColumnResource1"  
  SortExpression="SendNotification" 
  UniqueName="SendNotification"
</telerik:GridCheckBoxColumn> 
<telerik:GridTemplateColumn DataField="NotificationAddress"  
  meta:resourcekey="GridTemplateColumnResource11" 
  SortExpression="NotificationAddress" UniqueName="NotificationAddress"
  <EditItemTemplate> 
    <asp:TextBox ID="NotificationAddressTextBox" runat="server"  
      CausesValidation="True"  
      meta:resourcekey="NotificationAddressTextBoxResource1"  
      Text='<%# Bind("NotificationAddress") %>' MaxLength="1024"
    </asp:TextBox> 
    <asp:RegularExpressionValidator ID="NotificationAddressTextBoxValidator" 
      runat="server" ControlToValidate="NotificationAddressTextBox"  
      CssClass="ValidationError" Display="Dynamic" 
      ErrorMessage="Invalid e-mail address"  
      meta:resourcekey="NotificationAddressTextBoxValidatorResource1" 
      ValidationExpression="..."
    </asp:RegularExpressionValidator> 
    <asp:CustomValidator runat="server" ID="SendNotificationToValidator" 
      EnableClientScript="true" 
      ControlToValidate="NotificationAddressTextBox" 
      ClientValidationFunction="CheckEmailRequired"  
      Display="Dynamic" ErrorMessage="e-mail address required." 
      ValidateEmptyText="true" />                                                 
  </EditItemTemplate> 
  <ItemTemplate> 
    <%# Eval("NotificationAddress") %>&nbsp; 
  </ItemTemplate> 
</telerik:GridTemplateColumn> 
 

And the related JavaScript function:

function CheckEmailRequired(source, args) { 
  var grid = $find("<%=AlertConfigurationRadGrid.ClientID %>"); 
  var MasterTable = grid.get_masterTableView(); 
 
  // Can I get the row or item from source or args? 
 
  var selectedRows = MasterTable.get_dataItems(); 
 
  // Can I ask each row if it is being edited? 
 
  for (var i = 0; i < selectedRows.length; i++) { 
    var row = selectedRows[i]; 
    var oldSendNotification = row.getDataKeyValue("SendNotification"); 
    var oldNotificationAddress = row.getDataKeyValue("NotificationAddress"); 
  } 
  args.IsValid = true
  return; 
 


Thanks for any ideas you can offer!

Tim

Tsvetoslav
Telerik team
 answered on 22 Apr 2009
2 answers
164 views
I have been at this now for awhile. didn't want to post as it seems a pretty simple thing to do.
no matter how i write it, I cannot get my detailtable filter expression to work.

Note the poststat of the mastertableview is different than the poststat of the detailtable.
<telerik:RadGrid  id="RadGrid2" runat="server"   
 GridLines="Horizontal" 
    AllowPaging="True"  AutoGenerateColumns="False">  
    <MasterTableView FilterExpression="([ActivityStatus] = 'Vacant') AND ([poststat] = 'Qualifying')"   
     DataKeyNames="Recordid">  
        <Columns> 
            <telerik:GridBoundColumn DataField="Recordid" DataType="System.Int32" HeaderText="Recordid" Visible="False" 
                ReadOnly="True" SortExpression="Recordid" UniqueName="Recordid">  
            </telerik:GridBoundColumn> 
            <telerik:GridBoundColumn DataField="PostingNumber" /> 
            <telerik:GridBoundColumn DataField="poststat" /> 
            <telerik:GridBoundColumn DataField="ActivityStatus" /> 
        </Columns> 
        <DetailTables> 
            <telerik:GridTableView Name="IA" FilterExpression="([AppStat] = 'Late')"   THIS IS NOT FILTERING!!!
            Caption="Internal Applicants"  DataKeyNames="Applicationid" 
                DataSourceid="AllApps"  runat="server">  
                <ParentTableRelation> 
                    <telerik:GridRelationFields DetailKeyField="Apps" MasterKeyField="Recordid" /> 
                </ParentTableRelation> 
                <Columns> 
                    <telerik:GridBoundColumn DataField="SenrBalance" HeaderText="Balance"  UniqueName="SenrBalance" /> 
                    <telerik:GridBoundColumn  DataField="PostStat" HeaderText="PostStat"   UniqueName="AppStat" /> 
                </Columns> 
            </telerik:GridTableView> 
            </DetailTables> 
        </MasterTableView> 
</telerik:RadGrid> 
 
      
         <asp:SqlDataSource ID="AllApps" runat="server" ConnectionString="<%$ ConnectionStrings:PHCJobPostsConn %>" 
             SelectCommand="Applicants" SelectCommandType="StoredProcedure">  
             <SelectParameters> 
                <asp:SessionParameter Name="Apps" SessionField="PostNum" /> 
              
             </SelectParameters> 
         </asp:SqlDataSource> 
    
    
    Protected Sub RadGrid2_NeedDataSource(ByVal source As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles RadGrid2.NeedDataSource  
        RadGrid2.DataSource = functions.dt(String.Format("exec SProc '706680'", Session("empID")))  
    End Sub 

this thing is driving me crazy
mac
Yavor
Telerik team
 answered on 22 Apr 2009
2 answers
197 views
I have form template in grid. Form template contains NumericTextBox. I need to get GridDataItem object in OnValueChanged event handler. How can I implement it?
Princy
Top achievements
Rank 2
 answered on 22 Apr 2009
2 answers
200 views

<%

@ Page Language="VB" AutoEventWireup="false" CodeFile="RadWindow.aspx.vb" Inherits="RadWindow" %>

 

 

<!

 

DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

 

 

<%

@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>

 

<%

 

@ Register Assembly="RadWindow.Net2" Namespace="Telerik.WebControls" TagPrefix="radW" %>

 

 

<

 

html xmlns="http://www.w3.org/1999/xhtml" >

 

<

 

 

head runat="server">

 

 

 

<title>Untitled Page</title>

 

<

 

 

script language="javascript" type="text/javascript">

 

 

 

function ShowAddUserPage()

 

{

window.radopen(

 

"AccordionAjax.aspx", "ShowAddWindow");

 

}

 

</

 

script>

 

</

 

 

head>

 

<

 

 

body>

 

 

 

<form id="form1" runat="server">

 

 

 

<div>

 

 

 

<a href="" onclick="javascript:ShowAddUserPage();return false;">Test Code</a>

 

 

 

<radW:RadWindowManager ID="RadWindowManager2" VisibleOnPageLoad="false" Behavior="close" runat="server">

 

 

 

<Windows>

 

 

 

<radW:RadWindow OffsetElementId="ShowAddWindow" runat="server" Width="850px" Height="500px" Modal="true" ID="ShowAddWindow"></radW:RadWindow>

 

 

 

</Windows>

 

 

 

</radW:RadWindowManager>

 

 

 

<asp:LinkButton ID="lnkbtnRadOnCloseRefresh" runat="server"></asp:LinkButton>

 

 

 

</div>

 

 

 

 

 

</form>

 

</

 

 

body>

 

</

 

 

html>

 

 

when i run the above application i am the follwoing error

Cannot find file /FirstAjaxApp/RadControls/Window/Skins/Default/CoreTemplates.xml.Please make sure it is there, or provide HTML code for the window templates using the MinimizeTemplate, AlertTemplate, ConfirmTemplate, PromptTemplate properties of RadWindowManager

what is this error about? and what is the use of 

where do we find  the defination for window.radopen("") function ??

did i missed any setup ?

Pleae help  me out?
i am new to this radcontrols ? in our project we are using this radcontrols.

please guide me about this ...





Georgi Tunev
Telerik team
 answered on 22 Apr 2009
1 answer
123 views
Hi
     I get a method which can return records as a dataset,and i set the dataset as data source of a radgrid as following
 
    protected void dgvUnselect_NeedDataSource(object source, GridNeedDataSourceEventArgs e) 
    { 
        UserSessionContainer usc = USCHelper.GetUserSessionContainer(Session); 
        DataSet items = Product.Product_SelectAll_ByCustomerId_And_ByProductDescription_AsDataSet(usc.Selected_CouponId); 
        this.dgvUnselect.DataSource = items; 
    } 
The problem is that there are large amount records(more than 100000) in this dataset,so this page  is very laggy. I've already read this article http://demos.telerik.com/aspnet-ajax/grid/examples/programming/custompaging/defaultcs.aspx, and i do not think it is useful for me, i just wonder if there is any solution in other ways which do not use the "ObjectDataSource",because i must get records from method Product.Product_SelectAll_ByCustomerId_And_ByProductDescription_AsDataSet(usc.Selected_CouponId)

 Regards

Chan
Nikolay Rusev
Telerik team
 answered on 22 Apr 2009
1 answer
75 views



Please help me to create a chart like this...

I have total 10 pens and i took 5 out of that ten...then i need to show this data in a single bar ..where bar total length should be 10 and should mark upto five..horizondally...
Dessy
Telerik team
 answered on 22 Apr 2009
3 answers
104 views

Situation:

I have multiple-paged Grid control on the page. It showing all positions in cathegory that user selected.

User can search items via search-engine and it shows elements as a list.

When user clicks on element in search-list, I need to refresh Grid and load all elements from cathegory clicked element belongs to.

Also I need to select this element in Grid and there is the problem: I can not find it in Grid.Items collection if this element not on current page.

Do anybody knows how to get all items ( but not only items from currently selected page ) or may be I doing something worng and there is another way should be used?

Nikolay Rusev
Telerik team
 answered on 22 Apr 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?