class PreventClipboardOperationsTextBox : TextBox
{
// Default dummy context menu
private System.Windows.Forms.ContextMenu _contextMenu;
// Constants
private const Keys CopyKeys = Keys.Control | Keys.C;
private const Keys CutKeys = Keys.Control | Keys.X;
private const Keys PasteKeys = Keys.Control | Keys.V;
public PreventClipboardOperationsTextBox()
{
// Create a dummy context menu to prevent the
// default Copy/Cut/Paste context menu from showing up
_contextMenu = new ContextMenu();
this.ContextMenu = _contextMenu;
}
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
// If any of the Copy/Cut/Paste shortcut keys are pressed,
// then just return true to indicate that the command key has already been processed
if((keyData == CopyKeys) || (keyData == CutKeys) || (keyData == PasteKeys))
{
return true;
}
else
{
return base.ProcessCmdKey(ref msg, keyData);
}
}
};
Wednesday, February 3, 2010
Tuesday, January 12, 2010
Q. ASP.NET code behind function into grid view template field?
Q. How to call asp.net code behind function into gridview template field?
Answer: we can call code behind function in the gridview as follows
In asp.net markup:
<asp:TemplateField HeaderText="IsEnable">
<ItemTemplate>
<center>
<asp:Image ID="imgUserState" runat="server" Width="10px" Height="10px" ImageUrl='<%#GetImage(Eval("IsEnable")) %>'></asp:Image>
</center>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="IsApprover">
<ItemTemplate>
<center>
<asp:Image ID="imgApproverState" runat="server" Width="10px" Height="10px" ImageUrl='<%#GetImage(Eval("IsApprover")) %>'></asp:Image>
</center>
</ItemTemplate>
</asp:TemplateField>
In c# code behind file
protected string GetImage(object ob)
{
bool IsActive = Convert.ToBoolean(ob);
if (IsActive) return @"~/images/yes.png";
else return @"~/images/no.png";
}
Output is:
Answer: we can call code behind function in the gridview as follows
In asp.net markup:
<asp:TemplateField HeaderText="IsEnable">
<ItemTemplate>
<center>
<asp:Image ID="imgUserState" runat="server" Width="10px" Height="10px" ImageUrl='<%#GetImage(Eval("IsEnable")) %>'></asp:Image>
</center>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="IsApprover">
<ItemTemplate>
<center>
<asp:Image ID="imgApproverState" runat="server" Width="10px" Height="10px" ImageUrl='<%#GetImage(Eval("IsApprover")) %>'></asp:Image>
</center>
</ItemTemplate>
</asp:TemplateField>
In c# code behind file
protected string GetImage(object ob)
{
bool IsActive = Convert.ToBoolean(ob);
if (IsActive) return @"~/images/yes.png";
else return @"~/images/no.png";
}
Output is:
Thursday, January 7, 2010
Web designing stuff
http://davidwebb.blogspot.com/
http://jqueryfordesigners.com/
http://www.noupe.com/tutorial
http://www.tutelibrary.com/2008/08/creating-mac-style-drop-down-menu-with.html
http://www.dreamcss.com/2009/04/15-jquery-menu-dropdown-ipod-drilldown.html
http://www.ajaxline.com/10-best-jquery-menu-plugins
http://www.sohtanaka.com/web-design/mega-drop-downs-w-css-jquery/
http://jqueryfordesigners.com/
http://www.noupe.com/tutorial
http://www.tutelibrary.com/2008/08/creating-mac-style-drop-down-menu-with.html
http://www.dreamcss.com/2009/04/15-jquery-menu-dropdown-ipod-drilldown.html
http://www.ajaxline.com/10-best-jquery-menu-plugins
http://www.sohtanaka.com/web-design/mega-drop-downs-w-css-jquery/
Tuesday, January 5, 2010
Aravind Kumar Pampana's New SMS Channel
Click the following link to subscribe my new SMS channel for latest technology updates and news.
http://labs.google.co.in/smschannels/subscribe/Aravind00Kumar
http://labs.google.co.in/smschannels/subscribe/Aravind00Kumar
Subscribe to:
Posts (Atom)
