|
This is what I tried in my SelectIndexChanged event:
protected void DateFrom_SelectedIndexChanged(object sender, EventArgs e)
{
calDateFrom.Visible = true;
this.DateFrom.Text = calDateFrom.SelectedDate.ToString();
}
And it doesn't quiet work
|
|
|
|
|
It should be visible as per code.Try by default visible true and whether it is visible on the page or not..Also check might be it is getting false at some other point in application.
|
|
|
|
|
MorgSim wrote: protected void DateFrom_SelectedIndexChanged(object sender, EventArgs e)
This event will fire when you change dropdownlist item and won't fire on mouse over. If you want it on mouse over then you can try javascript.
|
|
|
|
|
Thanks man, am not that good with javascript though, but still trying out google.
If you know how I can handle this please help me...
Thanks,
Morg
|
|
|
|
|
Have a look at this.
Hope this helps.
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
Thanks man I will go through your article
|
|
|
|
|
You are welcome
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
Hi Morg,
You can use javascript to hide/display your calendar please check below example:
<script type="text/javascript" language="javascript">
function ShowHideCalendar() {
var obj = document.getElementById('yourCalendarId');
if (obj.style.display == 'block') {
obj.style.display = 'none';
}
else {
obj.style.display = 'block';
}
}
</script>
<asp:DropDownList runat="server" ID="ddlMyDropDown" onmousover="ShowHideCalendar();">
<asp:ListItem Value="1">item 1</asp:ListItem>
<asp:ListItem Value="2">item 2</asp:ListItem>
</asp:DropDownList>
Regards,
Jamil
|
|
|
|
|
Thanks very much Jamil this was very helpful, exactly what I was strugling with
|
|
|
|
|
you are welcome
Regards,
Jamil
|
|
|
|
|
HI ALL,
I have one requirement
i want to create one grid view in a grid view
first column and row will come from the data base
00:00 - 08:00 | 08:00 - 20:00 | 20:00 24:00 ( this is timing)
feesbydrA want textbox
feesbydrB
feesbydrC
excep these all will be text box where i can mace entry and can save.
Thanks and regards
amit Patel
|
|
|
|
|
So create your gridview anf if face any problem post your issue
|
|
|
|
|
i have already created grid view but those text boxes are not coming how to add dynamically template field.
|
|
|
|
|
Can you post your code snippet?
|
|
|
|
|
<br />
<asp:gridview ID="Gridview1" runat="server" ShowFooter="true" <br />
AutoGenerateColumns="false" onrowediting="Gridview1_RowEditing"><br />
<br />
<Columns><br />
<br />
<asp:BoundField DataField="RowNumber" HeaderText="Modality" /><br />
<br />
<asp:TemplateField HeaderText="00:00-08:00"><br />
<br />
<ItemTemplate><br />
<br />
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox><br />
<br />
</ItemTemplate><br />
<br />
</asp:TemplateField><br />
<br />
<asp:TemplateField HeaderText="08:00-20:00"><br />
<br />
<ItemTemplate><br />
<br />
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox><br />
<br />
</ItemTemplate><br />
<br />
</asp:TemplateField><br />
<br />
<asp:TemplateField HeaderText="20:00-24:00"><br />
<br />
<ItemTemplate><br />
<br />
<asp:TextBox ID="TextBox3" runat="server"></asp:TextBox><br />
<br />
</ItemTemplate><br />
<br />
<%-- <FooterStyle HorizontalAlign="Right" />--%><br />
<br />
<%-- <FooterTemplate><br />
<br />
<asp:Button ID="ButtonAdd" runat="server" Text="Add New Row" OnClick ="ButtonAdd_Click" /><br />
<br />
</FooterTemplate>--%><br />
</asp:TemplateField><br />
<br />
</Columns><br />
<br />
<br />
</asp:gridview><br />
<br />
this function is initializing grid<br />
<br />
private void SetInitialRow()<br />
{<br />
ReportAction reporting = new ReportAction();<br />
Int32 userId = Convert.ToInt32(Session["userId"].ToString());<br />
MySqlDataReader reader = reporting.getModalityList(userId);<br />
int numberofmodality = 0;<br />
<br />
while (reader.Read())<br />
{<br />
if (numberofmodality == 0)<br />
{<br />
DataTable dt = new DataTable();<br />
<br />
DataRow dr = null;<br />
<br />
dt.Columns.Add(new DataColumn("RowNumber", typeof(string)));<br />
<br />
dt.Columns.Add(new DataColumn("Column1", typeof(string)));<br />
<br />
dt.Columns.Add(new DataColumn("Column2", typeof(string)));<br />
<br />
dt.Columns.Add(new DataColumn("Column3", typeof(string)));<br />
<br />
dr = dt.NewRow();<br />
<br />
dr["RowNumber"] = reader[1].ToString();<br />
<br />
dr["Column1"] = string.Empty;<br />
<br />
dr["Column2"] = string.Empty;<br />
<br />
dr["Column3"] = string.Empty;<br />
<br />
dt.Rows.Add(dr);<br />
<br />
dr = dt.NewRow();<br />
<br />
<br />
ViewState["CurrentTable"] = dt;<br />
<br />
Gridview1.DataSource = dt;<br />
Gridview1.DataBind();<br />
numberofmodality++;<br />
}<br />
else<br />
{<br />
}<br />
<br />
}<br />
<br />
}<br />
<br />
<br />
This function is adding column<br />
<br />
private void AddNewRowToGrid(string modality)<br />
{<br />
<br />
int rowIndex = 0;<br />
<br />
if (ViewState["CurrentTable"] != null)<br />
{<br />
<br />
DataTable dtCurrentTable = (DataTable)ViewState["CurrentTable"];<br />
<br />
DataRow drCurrentRow = null;<br />
<br />
if (dtCurrentTable.Rows.Count > 0)<br />
{<br />
<br />
for (int i = 1; i <= dtCurrentTable.Rows.Count; i++)<br />
{<br />
<br />
TemplateField ckhColumn = new TemplateField();<br />
<br />
TextBox box1 = (TextBox)Gridview1.Rows[rowIndex].Cells[1].FindControl("TextBox1");<br />
<br />
TextBox box2 = (TextBox)Gridview1.Rows[rowIndex].Cells[2].FindControl("TextBox2");<br />
<br />
TextBox box3 = (TextBox)Gridview1.Rows[rowIndex].Cells[3].FindControl("TextBox3");<br />
<br />
drCurrentRow = dtCurrentTable.NewRow();<br />
<br />
drCurrentRow["RowNumber"] = modality;<br />
<br />
drCurrentRow["Column1"] = box1.Text;<br />
<br />
drCurrentRow["Column2"] = box2.Text;<br />
<br />
drCurrentRow["Column3"] = box3.Text;<br />
<br />
rowIndex++;<br />
<br />
}<br />
<br />
<br />
dtCurrentTable.Rows.Add(drCurrentRow);<br />
<br />
<br />
ViewState["CurrentTable"] = dtCurrentTable;<br />
<br />
<br />
Gridview1.DataSource = dtCurrentTable;<br />
<br />
Gridview1.DataBind();<br />
<br />
}<br />
<br />
}<br />
<br />
else<br />
{<br />
<br />
Response.Write("ViewState is null");<br />
<br />
}<br />
<br />
<br />
<br />
}<br />
<br />
this is my grid view
i dont want to define template field in code it should come from the database
|
|
|
|
|
|
Hi,
I have developed a web application and created a virtual directory of that application(which is of Windows server 2003).After two weeks i found a problem.
ie when a user login(via virual directory link) i am taking his userid from database(sql 2005) with given userid and password and assigning that userid in session
ie Session["UserId"] = int.Parse(dstLogin.Tables[0].Rows[0]["UserId"].ToString());
then i am checking whether it is null or not
if (Session["UserId"] != null)
{
Response.Redirect("Home.aspx");
}
but in other pages when a user adding some data to database
i am not getting this UserId there.
ie while inserting userid of insering person will also store in database.while designing the table i made that field as "not null".
Not regularly but sometime users are getting an error like this
"Cannot insert userid as null". But most time it works fine
any solution or any idea to prevent this?
Known is a drop, unknown is an ocean
|
|
|
|
|
You problem is not very clear. Code is also looking fine .There must be some the data is not retrieved properly and not saved properly in session etc.. Have proper checks at the time saving and retrieving the data.. you'll get the actaul problem
|
|
|
|
|
Hi,
i ve developed an application which is now in testserver.my mates are testing(using the virtal directory link) it by entering data.last 2 week it was fine.but from last day after entering more than 30000 data now they are getting error which is i mentioned above. when i restart or move mouse of that testserver , again it works fine. after 5 mins (i think if there is any slow internet connection) it will raise same error. ive to do same thing again and again.
this is the problem
Known is a drop, unknown is an ocean
|
|
|
|
|
|
Hi all, i new at asp.net and need to create a website page using asp.net , but i don't know how<<<<<<<<<<<<<<
regards...
|
|
|
|
|
Well, try searching on CP or google, there are thousands of articles - or go out and buy a book.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
So buy some basic ASP.NET book and study..
|
|
|
|
|
|
In my project, onrowEditing is inside the childgrid. The parentgrid doesnot have onrowEditing.In this case, is it possible to find the id of childgrid inside onrowEditing method?
Thanks in Advance
|
|
|
|