Here i will show how you can show linkButton in silverlight2 DataGrid:--
For my Project I needed to show a column as a link button. for implementing this i first tried using standard linkButton in DataTemplate:
XAML Markup:
<datatemplate key="BudgetTemplate">
<border borderthickness="5,0,0,0">
<hyperlinkbutton content="{Binding Budget}">
</hyperlinkbutton>
</border>
</DataTemplate>
then set the CelTemplate in DataGrid's Autogenaration Column event-
Code:
if(e.PropertyName == "Budget")
{
DataGridTemplateColumn budgetColumn = new DataGridTemplateColumn();
budgetColumn.Header = "Budget";
budgetColumn.CellTemplate = (DataTemplate)Resources["BudgetTemplate"];
e.Column = budgetColumn;
}
But after doing this it was not working properly. like when im going another page by clicking the hyperlinkButton then back agin this page the seleced row was hidden/blur for some reason. and there was no underline in the Hyperlinkbuttn when mouse hover.
the i tried in little different ways. i use a textblock instead of a linkbutton:
XMAL Markup:
<DataTemplate x:Key="BudgetTemplate">
<Border BorderThickness="1.5,0,0,0" BorderBrush="DarkGray">
<StackPanel Orientation="Vertical">
<TextBlock x:Name="budgetTextBlock" Foreground="#FF065091" Width="auto" MouseLeftButtonUp="budgetTextBlock_MouseLeftButtonUp" MouseEnter="budgetTextBlock_MouseEnter" MouseLeave="budgetTextBlock_MouseLeave"
Text="{Binding Budget}" Cursor="Hand"
Margin="2,0,5,0" TextAlignment="Right" HorizontalAlignment="Right"/>
</StackPanel>
</Border>
</DataTemplate>
And set the CelTemplate in the same ways. for showing the underline i use the mouse Enter and MouseLeave event:
private void budgetTextBlock_MouseEnter(object sender, MouseEventArgs e)
{
((TextBlock)sender).TextDecorations = TextDecorations.Underline;
((TextBlock)sender).FontWeight = FontWeights.SemiBold;
}
private void budgetTextBlock_MouseLeave(object sender, MouseEventArgs e)
{
((TextBlock)sender).TextDecorations = null;
((TextBlock)sender).FontWeight = FontWeights.Normal;
}
And it worked fine for me.
Tuesday, September 15, 2009
Monday, March 23, 2009
bubble sort in C#
int[] number = { 1, 6, 3, 9, 2, 8 };
int temp =0;
for (int i = number.Length ; i>=1; i--)
{
for (int j = 0; j < i-1; j++)
{
if (number[j]>number[j+1])
{
temp = number[j+1];
number[j + 1] = number[j];
number[j] = temp;
}
}
}
// Display the result in the messageBox
for (int i = 0; i < number.Length; i++)
{
MessageBox.Show(number[i].ToString());
}
int temp =0;
for (int i = number.Length ; i>=1; i--)
{
for (int j = 0; j < i-1; j++)
{
if (number[j]>number[j+1])
{
temp = number[j+1];
number[j + 1] = number[j];
number[j] = temp;
}
}
}
// Display the result in the messageBox
for (int i = 0; i < number.Length; i++)
{
MessageBox.Show(number[i].ToString());
}
Thursday, March 5, 2009
Useful website for Programming
Programing Related
http://www.geekpedia.com -- for sample project, article etc great place..
http://codebetter.com/ --for technology update
http://mootools.net/
http://jquery.com/ -- java script library
http://blogs.sun.com/greimer/resource/loop-test.html
http://www.ultrapico.com/Expresso. -- for regx in java script
http://famfamfam.com/lab/icons/silk/ --- for icon
http://www.webappers.com/
resources for web developers
http://blogs.hibernatingrhinos.com/nhibernate/Default.aspx // NHiberNateMapping
http://www.w3schools.com/
best resource for DOM and JS
http://www.forkcan.com/ //==========FOR Sharing code in social way...
//for c# custom date format
http://www.csharp-examples.net/string-format-datetime/
//for C# example code
http://www.csharp-examples.net/examples/
// conceptual website
http://www.dotnetperls.com/
//Interview question and answer:
http://johnmarsing.wordpress.com/2011/02/20/
//For JAVA
http://extreme-java.blogspot.com/2011/02/top-java-blogs.html
//For Business intelligence
http://biarchanddesignguide.codeplex.com/releases/view/6572
Humor
http://thedailywtf.com/ --====== (and what not to do while programming)
http://www.collegehumor.com/ == funny vedio,pic etc
http://blogs.msdn.com/tess/archive/2008/09/09/asp-net-memory-identifying-pages-with-high-viewstate.aspx
Good blog, and relevant page
http://www.oredev.org/toppmeny/video/november13/tessferrandezcommonproblemsinaspnet.4.3f1ff754117a0ed3480800015509.html
good screencast about live debugging, can be good to know when deploying big complex websites
http://weblogs.asp.net/bleroy/archive/2008/12/29/why-are-scripts-slow-to-load-in-firefox-when-using-visual-studio-s-built-in-development-web-server-a-k-a-cassini.aspx
http://silverlight.net/blogs/msnow/archive/2008/09.aspx?PageIndex=1
for learning silverlight
http://xoax.net/comp/cpp/console/Lesson4.php
for learning visual c++ .net
//for Project Estimation
http://realdn.planningpoker.com/games/41712
// for daily useful web reference
http://jasonhaley.com/blog/
Entertainment
http://www.musicovery.com/
//for listening music
//for lunch break
http://www.quakelive.com/
History:
// history of bangladesh libaration war
http://www.liberationwarbd.org/
Math
// http://www.khanacademy.org/
IT Management
http://itmanagersinbox.com
Others
//for printing any page
http://www.printfriendly.com/
// for becoming a good developer
http://vimeo.com/17151526
// for complete professional web layout
http://layout.jquery-dev.net/demos/container.html
http://www.geekpedia.com -- for sample project, article etc great place..
http://codebetter.com/ --for technology update
http://mootools.net/
http://jquery.com/ -- java script library
http://blogs.sun.com/greimer/resource/loop-test.html
http://www.ultrapico.com/Expresso. -- for regx in java script
http://famfamfam.com/lab/icons/silk/ --- for icon
http://www.webappers.com/
resources for web developers
http://blogs.hibernatingrhinos.com/nhibernate/Default.aspx // NHiberNateMapping
http://www.w3schools.com/
best resource for DOM and JS
http://www.forkcan.com/ //==========FOR Sharing code in social way...
//for c# custom date format
http://www.csharp-examples.net/string-format-datetime/
//for C# example code
http://www.csharp-examples.net/examples/
// conceptual website
http://www.dotnetperls.com/
//Interview question and answer:
http://johnmarsing.wordpress.com/2011/02/20/
//For JAVA
http://extreme-java.blogspot.com/2011/02/top-java-blogs.html
//For Business intelligence
http://biarchanddesignguide.codeplex.com/releases/view/6572
Humor
http://thedailywtf.com/ --====== (and what not to do while programming)
http://www.collegehumor.com/ == funny vedio,pic etc
http://blogs.msdn.com/tess/archive/2008/09/09/asp-net-memory-identifying-pages-with-high-viewstate.aspx
Good blog, and relevant page
http://www.oredev.org/toppmeny/video/november13/tessferrandezcommonproblemsinaspnet.4.3f1ff754117a0ed3480800015509.html
good screencast about live debugging, can be good to know when deploying big complex websites
http://weblogs.asp.net/bleroy/archive/2008/12/29/why-are-scripts-slow-to-load-in-firefox-when-using-visual-studio-s-built-in-development-web-server-a-k-a-cassini.aspx
http://silverlight.net/blogs/msnow/archive/2008/09.aspx?PageIndex=1
for learning silverlight
http://xoax.net/comp/cpp/console/Lesson4.php
for learning visual c++ .net
//for Project Estimation
http://realdn.planningpoker.com/games/41712
// for daily useful web reference
http://jasonhaley.com/blog/
Entertainment
http://www.musicovery.com/
//for listening music
//for lunch break
http://www.quakelive.com/
History:
// history of bangladesh libaration war
http://www.liberationwarbd.org/
Math
// http://www.khanacademy.org/
IT Management
http://itmanagersinbox.com
Others
//for printing any page
http://www.printfriendly.com/
// for becoming a good developer
http://vimeo.com/17151526
// for complete professional web layout
http://layout.jquery-dev.net/demos/container.html
Sunday, January 25, 2009
How to query in a sharepoint List
the following function will take an User Name as a parameter and will return the section for the user--------------------------------------------------------------
private string GetSectionByUserName(string userName)
{
string section = string.Empty;
SPList userList = SPContext.Current.Web.SiteUserInfoList;
SPQuery query = new SPQuery();
query.Query = "<Where><Eq><FieldRef Name='Author'/><Value Type='Text'>"+ userName + "</Value></Eq></Where>";
SPListItemCollection itemCollection = userList.GetItems(query);
if (itemCollection.Count > 0)
{
section = itemCollection[0]["Section"].ToString();
}
return section;
}
private string GetSectionByUserName(string userName)
{
string section = string.Empty;
SPList userList = SPContext.Current.Web.SiteUserInfoList;
SPQuery query = new SPQuery();
query.Query = "<Where><Eq><FieldRef Name='Author'/><Value Type='Text'>"+ userName + "</Value></Eq></Where>";
SPListItemCollection itemCollection = userList.GetItems(query);
if (itemCollection.Count > 0)
{
section = itemCollection[0]["Section"].ToString();
}
return section;
}
Subscribe to:
Posts (Atom)
5 Strategies for Getting More Work Done in Less Time
Summary. You’ve got more to do than could possibly get done with your current work style. You’ve prioritized. You’ve planned. You’ve dele...

-
Sometimes just to get a quick success build you might need to disable/ignore/skip some of the munit test cases. you can do you by double ...
-
Some times you might need to return static response from nginx. for example validating file upload limit error_page 413 @413_x...
-
Install ActiveMQ Step 1: Download Apache Active MQ 5.x.x (5.15.8 Latest Version Up to Feb 2019) Step 2: Install ActiveMQ Run the Active...