Bharath Radhekrishna

Archive for the ‘108 Situations’ Category

Disabling some of the Textboxes in gridview edit

Posted by: onetidbit on: May 4, 2009

Situation: You need some text boxes disable when gridview is in edit mode.
=======
Solution:
======
1) Bind the Data without Sqldatasource Control
2) In Row Editing write the code:
protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
{
GridView1.EditIndex = e.NewEditIndex;
[...]

How to invoke a user defined event in the controls of Gridview

Posted by: onetidbit on: February 24, 2009

How to invoke a user defined event in the controls of Gridview
=============================
1) In aspx Take a gridview having one of the template fields i.e Item Template as LinkButton
<asp:TemplateField HeaderText=”Folio No”>
<EditItemTemplate>
<asp:TextBox ID=”TextBox1″ runat=”server” Text=’<%# Bind(“Folio_no”) %>’></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:LinkButton ID=”Label2″ runat=”server” Text=’<%# Bind(“Folio_no”) %>’ OnClick=”click” ></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
2) In Code-behind Page:
protected void click(object sender, EventArgs e)
{
LinkButton lb = (LinkButton)sender;
GridViewRow gvr = [...]

Dropdownlist in gridview

Posted by: onetidbit on: February 21, 2009

Hi All,
The situation is Dropdownlist in Gridview.
While displaying the summary or reports we will use a Label for a particular column.
But in edit mode it must open in dropdownlist with selected Values as in the previous static mode.
I will explain clearly:
There is a table in database Months_TBL.
which contains 12 months.
1) First we must bind this [...]

Place vb and cs files together in App_Code folder

Posted by: onetidbit on: November 25, 2008

Sometimes while using class files in asp.net we will face the situation where we want to place both Vb and Cs class files.The simple solution is:
1) First make two folders in App_code with foldernames as 1)CSCode 2)VBCode
2) Modify the Web.conig with following code:
<compilation debug=”false”>
<codeSubDirectories>
[...]

Hello  everybody. When I am trying to send an email with HTML format the values are coming from database i felt problem with godaddy server.
నేను ఒకసారి GoDaddy ద్వారా ఈమెయిలు పంపిస్తుంటే చాలా ప్రొబ్లెంస్ వచ్చాయి
నేను వాటిని పరిశోధించి చివరికి చిన్న సమాధానం కనుకునా ఏమైనా సందేహం వుంటే మెయిల్ చెయ్యండి
Email; radhek@gmail.com
To solve that we must add relay hosting.
I’d just like [...]