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

Folks,

Using VS 2010 with RadControls for ASP.NET AJAX Q2 2012 SP1.

Assuming I  have a SS# with Value 799999991. I would like to display/mask it in Below RadMaskedTextBox as 799-99-9991 also save into database table as 799-99-9991 not as 799999991. Below is declaration.

Thanks

gc_0620 


<telerik:RadMaskedTextBox ID="TxtSoc_Sec_Num"  runat="server" Mask="###-##-####" CssClass="gridTextBox" Text='<%# Bind( "Soc_Sec_Num") %>'>
  
</telerik:RadMaskedTextBox>
<asp:RegularExpressionValidator ID="RegularExpressionValidatorTxtSoc_Sec_Num" runat="server"
    Display="None" ErrorMessage="! Soc. Sec# must be in: 999-99-999 Format." ValidationExpression="\d{3}-\d{2}-\d{4}"
    SetFocusOnError="true" ControlToValidate="TxtSoc_Sec_Num">
</asp:RegularExpressionValidator>
gc_0620
Top achievements
Rank 1
 answered on 20 Sep 2012
25 answers
697 views
I have created a Pivot Table in RadGrid with AutoGeneratedColumns using a published example. As a specific column "StatDate" is created, I would like to format the date value in the OnColumnsCreated handler. As the example shows, I am checking for the column's "UniqueName" property but have determined that the column's "value" not name is returned. I have since seen either a single digit number or the string "ExpandColumn"

note: the datasource is a SQL Server stored procedure

Thanks,

SteveO

 

 


public
DataTable PivotTable(DataTable source)

 

{

 

 

DataTable dest = new DataTable("Pivoted" + source.TableName);

 

dest.Columns.Add(

 

" ");

 

 

 

foreach (DataRow r in source.Rows)

 

dest.Columns.Add(r[0].ToString());

 

 

for (int i = 0; i < source.Columns.Count - 1; i++)

 

{

dest.Rows.Add(dest.NewRow());

}

 

 

for (int r = 0; r < dest.Rows.Count; r++)

 

{

 

 

for (int c = 0; c < dest.Columns.Count; c++)

 

{

 

 

if (c == 0)

 

dest.Rows[r][0] = source.Columns[r + 1].ColumnName;

 

 

else

 

dest.Rows[r][c] = source.Rows[c - 1][r + 1];

}

}

dest.AcceptChanges();

 

 

return dest;

 

}

 

 


protected
void RadGrid1_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)

 

{

RadGrid1.DataSource = PivotTable(GetDataTable(

 

"SELECT CONVERT(varchar,StatDate,101) StatDate,FelonyArrests,MisdArrests,NTA,FSAO,TrafficArrests,WarrantArrests,DispCalls,SelfInitActivities,[BackUp] BackUps,FIR," +

 

 

 

"VehRecov,TrafficCitations,CourtesyNotices,TrafficStops,WarrantsServed,WarrantsObtained,NewGangFiles,GangFileUpd,Presentations,InvestHours," +

 

 

 

"IntelRpts,PropValRecov,GunsRecov,IntelBullitens,SearchWarrantHours,TasksAssigned,TasksTrans,TasksCleared,AssignedActive,Transfered," +

 

 

 

"ClearedByArrest,EC,Unfounded,Closed,Inactive,Surveillance,Callouts,SearchWarrants FROM Gang_Stats ORDER BY StatDate asc"));

 

 

}

 

 

protected void RadGrid1_ColumnCreated(object sender, Telerik.Web.UI.GridColumnCreatedEventArgs e)

 

{

 

 

if (e.Column.UniqueName == "StatDate")

 

{

 

 

GridBoundColumn boundColumn = e.Column as GridBoundColumn;

 

boundColumn.DataFormatString =

 

"{0:d}";

 

boundColumn.ItemStyle.Font.Bold =

 

true;

 

}

}

JSON
Top achievements
Rank 1
 answered on 20 Sep 2012
1 answer
101 views
I have a question, of how to save multiple rows in a RadGrid.
Example.
This loops through the entire RadGrid editable mode and assigned to all fields.

foreach (GridDataItem item in RadGrid1.Items)
        {
            item.Edit = true;
        }
        RadGrid1.MasterTableView.Rebind();  

I want to achieve something similar but obviously making a save in the datatable I give it as source.


Thanks

Jayesh Goyani
Top achievements
Rank 2
 answered on 20 Sep 2012
3 answers
164 views
Hi,

I have rad grid in my page and have running functionality of export to pdf also. Now I want to email that exported pdf to multiple persons, from code behind. I have context menu in grid and with option "Send Email" so when user click this option email should be generated automatically so that I can send it using SMTP.

Can you please help me in this? It's urgent for me.

Thanks,
Vatsal
Jayesh Goyani
Top achievements
Rank 2
 answered on 20 Sep 2012
1 answer
161 views
Hi there,

I have been trying different Telerik controls to get the functionality that I want but I've not been successful in getting it.  The functionality I want is pretty single.  I have a list of items (in a vertical list).  The list contains text, dropdowns, buttons, etc.  I would like the user to be able to drag and drop to re-order and list, and also add/remove rows.

The closet I've gotten was using RadDocks in a RadDockZone, however, I ran into a problem where I was not allowed to have a repeater inside the RadDockZone to repeat through my list and create RadDocks based on a set template.

I've tried a RadGrid, although I got the drag and drop to work, I did not want a grid like display.  It is possible to 

1) only have 1 column
2) customize that column depending on a template

Thanks
John
Eyup
Telerik team
 answered on 20 Sep 2012
3 answers
110 views
Is it possible to have a fixed row in the radgrid? That is, I'd liked a particular row to always be the first row in the grid, regardless of sorting criteria, etc.
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
 answered on 20 Sep 2012
9 answers
253 views
Hi.

This morning I migrated from the old 2010 Q1 version of ASP.NET AJAX to the just released 2012 Q2. All seems it's working fine, faster I think, but I have the following visualization trouble with RadDatePicker using the same stylesheets as 2010 Q1, I don't change anything.

I don't use embedded stylesheets, it was the same stylesheets unembedder because we'd like to change some things, but in other controls.

Regards.

Galin
Telerik team
 answered on 20 Sep 2012
2 answers
85 views
Here I am attaching the way and final out while we drag an drop the image button inside teaxtbox.
Slav
Telerik team
 answered on 20 Sep 2012
10 answers
252 views
Hi,

I'm trying to do footer validation where if the footer values in column a, b and c does not equal d, then update fails. Can you take a look at my code. Thanks. 

protected void RadGrid1_UpdateCommand(object source, GridCommandEventArgs e)
   {
       GridEditableItem editItem = (GridEditableItem)e.Item;
       GridFooterItem footerItem = RadGrid1.MasterTableView.GetItems(GridItemType.Footer)[0] as GridFooterItem;
       string column1 = footerItem["WEEKENDS_MTD"].Text;
       string column2 = footerItem["HOLIDAYS_MTD"].Text;
       string column3 = footerItem["BUSINESS_DAYS_MTD"].Text;
       string total = footerItem["CALENDAR_DAYS_MTD"].Text;
 
       int footervalue1;
       int footervalue2;
       int footervalue3;
       int footervalue4;
       int.TryParse(column1, out footervalue1);
       int.TryParse(column2, out footervalue2);
       int.TryParse(column3, out footervalue3);
       int.TryParse(total, out footervalue4);
 
 
 
 
 
       if (footervalue1 + footervalue2 + footervalue3 != footervalue4)
       {
           e.Canceled = true; // Cancel Update
           Response.Write("Cancelled");
            
       }
 
      
   }
Elton
Top achievements
Rank 1
 answered on 20 Sep 2012
1 answer
58 views
Hi,
Is it possible to set the appointment End time depending on the selected value of an attribute (which is a combobox)? Can this be acheived in codebehind or javascript?
Thanks.
Ivana
Telerik team
 answered on 20 Sep 2012
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?