SQL Server 2012 introduces a plethora of the new enhancements in T-SQL. With newly introduced syntax the code of the 100s lines can be reduced to merely few lines. By converting the old T-SQL syntax to new T-SQL syntax one can immediately get enormous performance improvement. This session will cover T-SQL tips and tricks which will make writing the code more fun!
Sharing knowledge in Project, Program, Portfolio Innovation Management (PPIM) and various Technology.
Monday, April 30, 2012
Tuesday, May 3, 2011
Sync Fushion Grid Control
Grid control. for that have tried all our asp.net datasource. but we couln't able to
increase. finally found Sync fusion control itself having data source object (Grouppassdatasource).
Grouppassdatasource:
which will connect from datacontext.
Datacontext.
you have to create using link to sql data file (deml extension).
Sync fusion datasource name is GroupPassdatasource
Note: GroupPassdatasource should be with update panel
Thursday, December 9, 2010
Motion Framework in Infragistics
It will be mainly used across the Silver light and wpf data visualization applications.
Running earlier version of Existing application in VS 2010.
lower version ( for example .net 2.0) application to building in the Visual studio 2010. Thanks to microsoft. The below element have to implement in the web.config file with the version details.
Element Name:
Sunday, December 5, 2010
URL Mapping in Visual studio 2010
There is method called "Response.RedirectPermanent()" will be used to map the url instead of using web.config method in the earlier version of Visual studio.
Wednesday, January 13, 2010
Visual Studio 2010 Part 1
His name is Teju’s from Microsoft Bangalore. He is a great Man and great attitude and more over is active and young. He has shown many features with us about visual studio 2010. Let’s talk one by one.
My view of session it was great and very informative. Really visual studio 2010 will rock soon all your system. Now we have Beta. Try the nice feature and rock.Carrier perspective it’s going to create lot of opportunities. Really you will love it and do it.
Microsoft comes up with the different packages for Visual studio 2010.
Visual Studio 2010-Ultimate.
This is comprehensive suite of application life cycle management tools for teams to ensure quality results from design to development.
Visual Studio 2010- Premium.
A complete tool set for developer to deliver scalable high quality applications.
Visual Studio 2010- Professional.
This is essential tool set for doing basic development tasks to allow developers to implement their ideas easily.
Visual Studio Test Elements-2010
This is separate tool apart from vsts 2010. This is specifically for the tester.
VSTS 2010 had plenty of improvements and new features. Let’s talk about some coolest and hottest feature.
Debugging and diagnosis:
1) Intelli trace.
a. It’s one of the best feature ever never heard from any other development areas.
This is give you exact definition about the problem. When we have situation like in production environment user’s are having some issues but not having in the other environment. That time only our Intellin trace comes in to picture.
2) Static Code Analysis.
It’s one of the coolest features. Using this tool can define the best practices of the code.
If you not followed the best practices and build will fails.
3) Code Metrics.
User can see the chart level description about the code.
4) 64 Bit Support.
5) Break point Improvement.
a. Filtering
b. Label attachment for each break point.
Architectural Complaints:
1) Layer Diagram:
This is one of the nice features once you assign the layer for the solution. It should stick on that.
2) One shot all dependencies can show.
3) UML Added.
WPF Improvements:
1) Touch Input can possible now.
2) Added new controls like Data grid and Date Picker.
Deployment:
1) One click deployment as like as f5.
Silver light:
1) Siliverlight template added.
Chart Controls
Now in vs2010 added chart control no need to use other third party controls. it available.
Also supports 3D.
Cloud Application
It’s possible with Window Azure.
Share Point
Now we have the project template for share point. All the manipulation can be done through this.
Team Foundation Server:
1) Gated check in.
It’s really coolest feature and user friendly to do it. There is a situation like developer always breaks build. For that we have gated check in to restrict to check in.
2) Self test.
Data can be saved temporarily not in the server location.
3) TFS-Web
Now also can see who is working what like that information can trace from anywhere else.
4) Packages
Now we are able to create packages. Maintainability is good.
Now parent and child hierarchy are available
Branch creation and merging are available.
Database Development:
1) Import schemas.
2) Synchronization available with offline and online.
3) Refactoring database.
Testing
It support’s manual and automated. This is separate development environment.
1) Unit Test wizard.
2) Data driven test.
3) Code coverage.
4) Test impact analysis.
5) Coded UI test with record UI functionality as like mercury and more than.
This is just introduction part. Hope will see many articles about VS2010.
Monday, January 11, 2010
Webservices using Silverlight 2.0
Before connecting to webservices. we should aware of security, data integrity, binding, performance.
using silverlight user connect diferent services.the services are webservice, WCF service and REST.
hope know about webservice and wcf, so all are asking about REST. Rest means RePresentation of state transition.
through webclient and httpwebrequest can connect and get the response.
usually webservices can connect through http. while connecting you have to maintain the thread. it's should
run with in thread only. if you not connect through proxy. you should maintain the thread. other wise it would
be problem.
Method 1:
Calling ASMX webservices.
Step 1:
Create asmx webservice and in to silverlight application as a service reference.
Step 2:
ADD namespace in the using section.
Step 3:
Get path of asmx file through this method.
public string GetURLforResource(string resourcePage) { string webURL = HtmlPage.Document.DocumentUri.ToString(); string containerPage = webURL.Substring(webURL.LastIndexOf("/") + 1); return webURL = webURL.Replace(containerPage, resourcePage); }
Step 4:
Call webservice through this. string webServiceURL = GetURLforResource("WebserviceTest.asmx"); BasicHttpBinding binding = new BasicHttpBinding(); WebserviceTestSoapClient webSVC = new WebserviceTestSoapClient(binding,new EndpointAddress(webServiceURL)); webSVC.HelloWorldCompleted += new EventHandler
also for the method has to create the eventhandler.
Step 5:
This is the event handler to display the result of the webservice method.
void webSVC_HelloWorldCompleted(object sender, HelloWorldCompletedEventArgs e) {
HtmlPage.Window.Alert(e.Result); }
Method 2:
Calling WCF service.
Everything same as like the above. one thing must to do in web.config.
while creating wcf it will add automatically binding as wsHttpBinding instead of that
have to modify basicHttpBinding.
Method 3:
Coming soon
-
Friday, January 8, 2010
Navigation between XAML Pages using Silverlight 2.0
Before going in to navigation one thing keep in mind there is no direct way for navigating the xaml files in Silverlight 2.0.
Ok fine let's start our navigation journey. I have two ways to navigate between the xaml files.
let me explain one by one.
# Method 1: Using App.XAML
Step 1:
There is a Application_startup event in App.XAML which will decide the initial load page.
Before that comment all the line in this method. (Example://this.RootVisual = new Page();)
Here in this have to do some little trick.
Step 2:
Declare one public Grid outside the event.
like this: public static Grid root;
and then write this code in the application Startup event.
private void Application_Startup(object sender, StartupEventArgs e)
{
root = new Grid();
root.Children.Add(new Login());
this.RootVisual = root;
}
here only we are adding Grid as a parent control. under that we have xaml page.
Step 3:
Create one more method for navigation.
public static void Navigate(UserControl newPage)
{
UserControl oldpage = root.Children[0] as UserControl;
root.Children.Add(newPage);
root.Children.Remove(oldpage);
}
This is the method will navigate one xaml to another xaml. Basically it's just removing the old page and adding new page.
The above all three steps only in the App.XAML file.
Step 4:
Now come to Login.Xaml, this is the inital page which will load from App.XAML.
After successing the login user has to navigate to productlist page.
The below code will navigate to product list page.
private void Login_Success_Click(object sender, RoutedEventArgs e){App.Navigate(new Product()); }
#Method 2:
This is better approach compare to above.
In the silverlight application should have two files.
1) App.XAML2) Master.XAML
here in Master is the common file which will navigate the files through this.
let me go through step by step:
Step 1:
In the application_startup event load the Master.XAMl (Remove Automated code)
private void Application_Startup(object sender, StartupEventArgs e) {this.RootVisual = new Master();}
Step 2:
In the master page clear all the content except usercontrol tag.
<UserControl x:Class="SilverlightThird.Master" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Width="400" Height="300"> </UserControl>
Step 3:
In the code behind of Master page write the below code.
public partial class Master : UserControl { public Master() {
InitializeComponent(); if (this.Content == null) { this.Content = new Login(); } } public void Navigate(UserControl Nextpage){ this.Content = Nextpage; } }
Step 4:
Now come to Login.xaml file.
In the success method of login.xaml.cs file write this below it will navigate.
hope this will help.
Custom Fonts in Silverlight 2.0
it's really surprising me, it's very good feature.
follow the below stpes to create custom fonts in silverlight 2.0
Step1:
Create one silverlight applicaton. mean while get ttf extension file name.
Note: ttf is the extension for font.
step2:
Add atleast one ttf file in to our project folder
Example:webdings.ttf
step3:
after adding in to our project. add the code like the below in example.
then you will get the custom fonts in your browser.
Syntax:
FontFamily="Font_File_Name#Font_Name”
Example:
<TextBlock FontFamily="webdings.ttf#webdings" Text="Test"> </TextBlock>
Note:font_file_name and font_name is different except few.
if you give correct font_name then only it will work.
Accesssing Client bin Images in XAML.
Client Bin
Bluehils.jpg
imageaccess.xap
the above two files are there in the client bin.
if you want to access that image have to simple thing.
<Image Source="/Bluehills.jpg"> </Image>
Note:"/"
Thursday, January 7, 2010
Stylesheet using Silverlight.
In silverlight having different approach to creating styles. also styles can write in app.xaml in silverlight application.
app.xaml is a application resource file. it will shares styles accross all the pages.
also it will maintain all the configuration details.
This is the syntax for creating styles in App.XAML.
<Application.Resources>
<Style x:Key="stTextblock" TargetType="TextBlock"> <
Setter Property="Foreground" Value="Red"/> </Style>
</Application.Resources>
we can call this style accross all the pages and it's applicable only for TextBlock controls.
<Grid x:Name="LayoutRoot" Background="White">
<TextBlock x:Name="txtShow" Style="{StaticResource stTextblock}" Text="Bala">
</TextBlock> </Grid>
Tuesday, January 5, 2010
Best Practices for keeping large number of images in Silverlight
Step 1:
Create one silverlight application.
step 2:
Create silverlight class library.The name of the project solution is "Resource"
step 3:
maintain all the images under "Resource" library.
step 4:
Add the "Resouce" reference to silverlight application.
step 5:
Bind the images in to silverlight application.
Example
like this:<image source="Resource;component/picture/winter.jpg>
"Reource" is Assembly or application name.
Picture is folder name
SLsvcutil.exe in silverlight
The only way to generate the proxies in silverlight 2 through service reference.
But in silverlight 3 is different. it's having command line tool to geneate the proxies.
SLsvcutil.exe.
happy coding with silverlight.
Tuesday, December 29, 2009
Silver light 2.0 Timer
To create timer have to use Dispatchtimer in System.Windows.Threading.
Go through the below example.
<Canvas>
<Canvas.Resources>
<Storyboard x:Name="Timer">
<DoubleAnimation Storyboard.TargetName="rectTimer" Storyboard.TargetProperty="Width" BeginTime="0:0:0" Duration="2"></DoubleAnimation>
</Storyboard>
</Canvas.Resources>
<Rectangle Loaded="rectTimer_Loaded" Visibility="Collapsed" x:Name="rectTimer">
</Rectangle>
</Canvas>
private void rectTimer_Loaded(object sender, RoutedEventArgs e)
{
System.Windows.Threading.DispatcherTimer myDispatcherTimer = new System.Windows.Threading.DispatcherTimer();
myDispatcherTimer.Interval = new TimeSpan(0, 0, 0,1, 100);
myDispatcherTimer.Tick +=new EventHandler(myDispatcherTimer_Tick);
myDispatcherTimer.Start();
}
void myDispatcherTimer_Tick(object sender, EventArgs e)
{
HtmlPage.Window.Alert("TickEvent");
}
Monday, December 28, 2009
Making Transparent In Silverlight..
Example:
<Grid x:Name="LayoutRoot" Background="{x:Null}">
How do we extract "XAP" file in Silverlight?
It's like archive and contains all the resources of silverlight application.
How do we extract xap file?
Step1:
Copy the xap file from clientBin and store in desktop of your machine.
step2:
change the extension in to zip
Example:
test.xap
test.xap.zip
Now you can extract the file.
it's contains one dll and asemblymanifest.info
Event Handler Using Silverlight
event dynamically. It's usefull for dynamically craeate controls.
Example:
<Button Name="btnTest" Content="Test" Width="100" Background="Blue" Margin="1" Height="25"></Button>
public Page()
{
InitializeComponent();
btnTest.Click += btnTest_Click; //Attach Event
btnTest.Click -= btnTest_Click; //Detach Event
}
void btnTest_Click(object sender, RoutedEventArgs e)
{
MessageBox.Show("Hi How are you");
}
What is use of AppManifest.xml and Assemblyinfo.cs in Silverlight
App(Application) Manifest.
This is the place where we can find the list of assemblies used in the application.
Location Path:Properties/AppManifest
ApplicationInfo
It's contains the information about the project like version, name and publisher.
Location: Properties/Assemblyinfo.cs
Wednesday, December 23, 2009
HtmlPage.Window.Invoke in Silverlight
This method will invoke the javascript method from code behind.
Example
Page.xaml
<UserControl x:Class="_22Dec2009.Page" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Width="1024" Height="800"> <Grid x:Name="LayoutRoot" Background="White"> <Border BorderThickness="2" BorderBrush="AliceBlue" CornerRadius="2" Margin="3"> <Button x:Name="Test" Click="Button_Click" Content="Test" Background="AliceBlue" Width="30" Height="20"> </Button> </Border> </Grid></UserControl>
Page.xaml.cs
This is code it will call the javascript method.
private void Button_Click(object sender, RoutedEventArgs e)
{ HtmlPage.Window.Invoke("getAlert", false); }
Default.aspx
<script language="javascript">
function getAlert() {
alert("sdf"); } </script>
Have you noticed in the eventargs. here in silverlight different..
Note:
Also we can call the javascript method throgh this code.
HtmlPage.Window.CreateInstance("getAlert", false);
happy coding! Enjoy
Response Redirect in Silverlight.
here in silverlight we have to use below code navigate to from one pages to another pages.
in the code we can mention target as well as browser features like height width....
Example
HtmlPage.Window.Navigate(new Uri("http://www.google.com"),"_blank","width:100,height:20");
Full Screen Options in Silverlight.
This is namespace have to use for the making the full screen.
System.Windows;
Example code is
Application.Current.Host.Content.IsFullScreen=!Application.Current.Host.Content.IsFullScreen
Wednesday, December 16, 2009
Content Delivery Network.
when end user accessing this site it has to travel through wire from few hundred miles to thousand miles.for avoiding these microsoft come up with new network called "Content Delivery Network".
if we use this in our project the performance will increase.
let me explain how it will increase the performance. suppose if you are accessing the site in India.
Content delivery network will find the shortest distance network and then it will load the all library files.
Instead of loading from one place.
Example:
<script src="http://ajax.microsoft.com/ajax/jquery/jquery-1.3.2.min.js" type="text/javascript"></script>
instead of mentioning our own path
Wednesday, December 2, 2009
Materialized Views in Oracle
Materialized view is a database object that contains the result of a query (it actually contains the rows).
SQL> create materialized view mview
2 build immediate
3 refresh complete on demand
4 as select count(1) from
5 (select state,zip,city,count(1) from mv_test1 group by state,zip,city);
Materialized view created.
Depends on the REFRESH mode specified MV will be refreshed ON DEMAND, ON COMMIT or at specific time.
Advantage:
Main advantage is Improved query perfomance.
Example:
Same query which is used to create the MV is executed here and it took 1.26 secs.
SQL> select count(1) from
2 (select state,zip,city,count(1) from mv_test1 group by state,zip,city);
COUNT(1)
----------
347
Elapsed: 00:00:01.26.
But selecting from MV took 0.01 seconds.
SQL> select * from mview ;
COUNT(1)
----------
347
Elapsed: 00:00:00.01
Disadvantage:
If you use refresh option as ON COMMIT and the MV is created on a transaction table which go through several DML operations, DB resources will be utilized to refresh the MV, and in turn it will slow down the db performance.
Tuesday, November 24, 2009
"String Builder" function in Javascript using Ajax(Enabling Scriptmanager).
please follow the below steps to enable the Stringbuilder.
Step 1:
Add script manager tag in the aspx page.
Step 2:
Example:
<script type="text/javascript">
function buildAString(title)
{
var headTagStart = "";
var headTagEnd = "";
var titleTagStart = "";
var sb = new Sys.StringBuilder(this._headTagStart);
sb.append(titleTagEnd);
sb.append(title);
sb.append(titleTagEnd);
sb.append(headTagEnd);
// Displays: "The result: "
alert("The result" + sb.toString());
}
var title = "A Title";
buildAString(title);
</script>
Wednesday, November 11, 2009
Calling Parent Method from child control using Events & Delegates.
Event: it's handler which will call the delegate and it will call the method.
Delegate: it's a function pointer, it will point to the particular function.
Let me explain about calling parent method from the child control.
Step 1: create one aspx pages and usercontrol pages.
step 2:
In the usercontrol create one button and lable. The scenoria is like this when user click on the button has to call the child method as well as the parent method.
Step 3:
Create one user control with the following code.
Childcontrol.ascx
<asp:Button ID="btnShow" runat="server" />
<asp:Label ID="lblShow" runat="server"></asp:Label>
Childcontrol.ascx.cs
public delegate void callDelegate();
public event callDelegate callEvent;
protected void Page_Load(object sender, EventArgs e)
{
btnShow.Click += delegate
{
lblShow.Text = "Hi how are u";
this.showData();
};
}
protected virtual void showData()
{
if (this.callEvent != null)
{
this.callEvent();
}
}
Step 4:
Create one aspx page with name of Parent with the following code.
parent.aspx
<%@ Register Src="~/UserControl/Childuser.ascx" TagPrefix="child" TagName="UC" %>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Label ID="lblParent" runat="server"></asp:Label>
<child:UC id="UC1" runat="server"></child:UC>
</div>
</form>
</body>
</html>
parent.aspx.cs
protected void Page_Load(object sender, EventArgs e)
{
UC1.callEvent += new Childuser.callDelegate(UC1_callEvent);
}
void UC1_callEvent()
{
lblParent.Text = "Hi Parent";
}
Monday, November 9, 2009
Base Pages using C#.Net
for clearing the session in common place.
we can use some thing called base pages. so that we can keep the code in seprate place.
Step 1:
Create one class file with the name of basepages.cs.
This will contain the one method which will clear the session objects permanently.
Example:
public class BasePages:System.Web.UI.Page
{
public void clearSession()
{ if (Page.User.Identity.IsAuthenticated == false)
{ Session.Abandon();
Response.Redirect("login.aspx");
}
}
}
step 2
Create one login with the extension of .Aspx page.in the code behind just inherit that base class method.
public partial class SessionCheck : Performance.BasePages
{
protected void Page_Load(object sender, EventArgs e)
{
base.clearSession();
}
}
Thursday, November 5, 2009
Memory Profiler.
download: http://memprofiler.com/
Thursday, October 29, 2009
function overloading method in webservice.
enabling the function overloading. follow below steps.
1. Must Set Attributes of Web service. 2. Set binding ConformsTo = WSIProfile.None.
Sample Class with couple of overloaded methods which exposes as a webservice
Example:
Sample: using System;using System.Web;using System.Web.Services;using System.Web.Services.Protocols;
[WebService(Namespace = "http://tempuri.org/")]// set Binding information[WebServiceBinding(ConformsTo = WsiProfiles.None)] public class Service : System.Web.Services.WebService{ public Service () { //Uncomment the following line if using designed components //InitializeComponent(); }
// Set Message Name [WebMethod(MessageName="Add int Field")] public int Add(int a, int b) { return a + b; }
// Set Message Name [WebMethod(MessageName="Add float Field] public int Add(float a, float b) { return a + b; }}
Wednesday, October 28, 2009
Health monitoring
This is nice feature in the dotnet frame work 3.5
it will automatically write the event log, When you will not handle the exception in the application,
<system.web>
<healthMonitoring enabled="true"></healthMonitoring>
</system.web>
Monday, October 26, 2009
Calling method from one user control from other usercontrol with out using property.
and i have label in the other usercontrol.
when i click on the button have to assign some value for label of other usercontrol with
out using the property
Step 1:
create first user control with following control and method.
<asp:Button ID="btnSubmit" onclick="btnSubmit_Click" runat="server" Text="Submit" />
public void btnSubmit_Click(object sender, EventArgs e)
{
test2 t2 = (test2)Page.FindControl("test2");
t2.callBTN(sender, e);
}
step 2:
create second user control with label with assigning value.
<asp:Label ID="lbltest" runat="server"></asp:Label>
public void callBTN(object sender, EventArgs e)
{
lbltest.Text = "DDDD";
}
Enabling the zoom in and zoom out facility for image using Seadragon control in ajax.
simple to implement this functionality.. it's nice feature thanks to Ajax team.
Step 1:
Create one xml file with the following attributes with tag. these are the attribute and tag will describe the functionality.
<Image TileSize="256" Overlap="1" Format="png" ServerFormat="Default">
<Size Width="1024" Height="768"/>
</Image>
Step 2:
create css class with image.
step 3:
<ajaxToolkit:Seadragon ID="Seadragon"
runat="server"
SourceUrl="sample.xml"> //Step1
CssClass="seadragon" //step 2
<ajaxToolkit:Seadragon>
Friday, October 23, 2009
Showing context menu in the ultrawebgrid using javacript.
step1:
Create ultrawebgrid with Rowselection.(if not choose selected row property getActiveRow method will not work)
step2:
create web menu with property setting of Popupmenu.
step3:
Calling showmenu function from gridcell click of ultrawebgrid.
step4:
function showmenu(objGrid,objGridid,button)
{
var grid = igtbl_getGridById(objGrid);
if(grid.getActiveRow()!=null)
{
if(button==2)
{
igmenu_showMenu('uwmContextmenu',event);
return true;
}
}
else
{
alert("Please select atleast one row");
return false;
}
}
opening Infragistics webdialogwindow using javascript.
var dialogObject = $find("WebDialogWindowSchedule");
dialogObject.get_contentPane().set_contentUrl(TargetURL);
dialogObject._header.setCaptionText("Welcome");
dialogObject.show();
In our project we have to give option like. when ever click on the context menu.
have to show the webdialog window.
While loading have to hide the webdialogwindow. only when we click on the context menu
have to show the dialog. for that have to make width and height 0. when we click on the
context menu have to assign the widht and height.
We have come across some performance issue in the ultrawebgrid.
Please follow the below rules while doing code with infragistics.
1). Don't add dynamic controls in the Initialize row of the ultrawebgrid.
2). Use PreRender event of ultrawebgrid adding dynamic controls.
3). declare all the styles and properties in the code behind.
Explain.
if you declare properties of ultrawebgrid in the aspx. it will take more time to render. so always try to put in the codebehind.
Thursday, October 22, 2009
how to restrict back button using asp.net.
we shouldn't load the page again when we click on the back button.
Below code it will hide the back button. This is also one of the security leavl have to
follow in the transaction pages.
Response.Buffer = true;
Response.CacheControl = "no-cache";
Response.Cache.SetNoStore();
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.SetExpires(DateTime.Now.AddDays(-1));
Tuesday, October 20, 2009
Downcasting in OOPS
public class Class1
{
public string getValue()
{
return "sd";
}
}
public class class3 : Class1
{
public string GetValue1()
{
class3 cl =(class3) new Class1();
return cl.getValue();
}
}
Upcasting in OOPS
public abstract class Class1
{
public string getValue()
{
return "sd";
}
}
public class class3 : Class1
{
public string GetValue1()
{
Class1 SS =new class3();
return SS.getValue();
}
}
Reading and adding controls dynamically for templated Column in ultrawebgrid.
After moving the controls in to prerender performance got increased.
void uwgProduct_PreRender(object sender, EventArgs e)
{
TemplatedColumn col = (TemplatedColumn)uwgProduct.DisplayLayout.Grid.Bands[0].Columns.FromKey("HeaderCheck");
TemplatedColumn colChild = (TemplatedColumn)uwgProduct.DisplayLayout.Grid.Bands[1].Columns.FromKey("ChildCheck");
int rowTotalCount = uwgProduct.Rows.Count;
///Header////
for (int rowcount = 0; rowcount <>
{
CellItem objcellITem = (CellItem)col.CellItems[rowcount];
HtmlInputCheckBox htmlCheck = new HtmlInputCheckBox();
htmlCheck.Attributes.Add("onclick", "selectEachParent(event,this.value)");
htmlCheck.Attributes.Add("id", Convert.ToString(objcellITem.Value));
htmlCheck.Value = Convert.ToString(objcellITem.Value);
objcellITem.Controls.Add(htmlCheck);
}
////Header/////
////Child Display////////
int childTotalCount = colChild.CellItems.Count;
for (int childCount = 0; childCount <>
{
CellItem objcellITem = (CellItem)col.CellItems[rowIndex];
CellItem objcellITemChild = (CellItem)colChild.CellItems[childCount];
HtmlInputCheckBox htmlCheckChild = new HtmlInputCheckBox();
htmlCheckChild.Attributes.Add("onclick", "UnselectParent(event,this.value)");
htmlCheckChild.ID = Convert.ToString(objcellITem.Value) + "_" + Convert.ToString(objcellITemChild.Value);
htmlCheckChild.Value = Convert.ToString(objcellITem.Value) + "_" + Convert.ToString(objcellITemChild.Value);
objcellITemChild.Controls.Add(htmlCheckChild);
}
////End Child Display////////
}
Infragistics WebDataGrid validation.
var Gkey,GIndex;
function EnterEditModeValidate(objGrid,Obj1Edited)
{
Gkey = Obj1Edited._cell._column._key;
GIndex = Obj1Edited.getCell().get_row()._index;
}
function ExitingEditValidate(sender,evntArgs)
{
//var index=sender.get_columns().get_columnFromKey(Gkey).get_index();
//var value=sender.get_rows().get_row(GIndex).get_cell(index).get_value();
var innT = document.getElementById("wdgProductList_ed0");
var iChars = "!@#$%^&*()+=-[]\\\;,./{}|\":<>?~_";
if(innT!=null)
{
var sValue = innT.children[0].value;
if(Gkey=="ShipAddress")
{
if(sValue=="")
{
alert("Please enter the value");
evntArgs.set_cancel(true);
}
if(sValue.length > 40)
{
alert("Charecters should be below 40");
evntArgs.set_cancel(true);
}
for (var count = 0; count <>
{
if (iChars.indexOf(sValue.charAt(count)) != -1)
{
alert ("Your string has special characters. \nThese are not allowed.");
evntArgs.set_cancel(true);
}
}
}
}
}
Thursday, October 15, 2009
Adding controls in to ultrawebgrid using PreRenderMethod.
int rowTotalCount = uwgProduct.Rows.Count;
for (int rowcount = 0; rowcount < rowTotalCount; rowcount++)
{
CellItem objcellITem = (CellItem)col.CellItems[rowcount];
DropDownList drp = new DropDownList();
drp.Items.Add(new ListItem("test", "ss"));
drp.ID = "dd";
objcellITem.Controls.Add(drp);
}
Friday, October 9, 2009
Special Character Validation
for (var i = 0; i < objGridCellValue.length; i++)
{
if (iChars.indexOf(objGridCellValue.charAt(i)) != -1) {
alert ("Your string has special characters. \nThese are not allowed.");
return false;
}
}
Date Compare Function
{
var dtformat = new Date(dt)
return dt.format("MM/dd/yyyy");
}
function DateCompare(fromDt,toDt)
{
var arrFromdt=fromDt.split("/");
var arrTodt=toDt.split("/");
var fromDt=new Date(arrFromdt[2],replaceDt(arrFromdt[0]),replaceDt(arrFromdt[1]));
var toDt=new Date(arrTodt[2],replaceDt(arrTodt[0]),replaceDt(arrTodt[1]));
if(fromDt<=toDt)
{
return "1";
}
else
{
return "0";
}
}
function replaceDt(replaceValue)
{
if(parseInt(replaceValue)<10)
{
return replaceValue.replace('0','');
}
else
{
return replaceValue;
}
}
Friday, August 21, 2009
Asp DataGrid with Editable cell with out Postback using Javascript
Wednesday, August 12, 2009
What is the use of "Canvas" Controls?????
My first feel with Silverlight
Monday, August 10, 2009
javascript listbox problem
Friday, August 7, 2009
To fire onclick event automatically on page load using Javascript
HTMLElement.prototype.click = function()
var evt = this.ownerDocument.createEvent('MouseEvents');
evt.initMouseEvent('click', true, true, this.ownerDocument.defaultView, 1, 0, 0, 0, 0, false, false, false, false, 0, null);
this.dispatchEvent(evt);
}