|
I have done through SSRS Grouping. Question is not related to ASP.NET
But I could not find the SSRS Questions here?
So Where can I post SSRS Related Queries?
|
|
|
|
|
|
How can i add empty row in Grid View in ASP dot net using VB Dot net.
All fields are bound but i want to count TOTAL manually.
e.g
Type Col1 col2 col3
1 10 20 30
2 5 1 5
3 1 5 2
Total 16 26 37
Help please
|
|
|
|
|
You can add your code on GridView databound event ..
Vinod Kumar Prajapati
Software Engineer
EBC Publishing Pvt. Ltd.
|
|
|
|
|
Send me source code please
|
|
|
|
|
You can use ItemTemplate og GridView for inserting rows.
Use Label controls in that.
When you want to add empty row, add empty labels to it and later you can assign text to that row.
|
|
|
|
|
Yes .. You can do this. Just follow these simple steps mentioned here :
Add New Row in DataGrid[^]
Hope you like my solution.
|
|
|
|
|
Hi,
for that you can add footer template in your grid view and take rowdatbound event of the gridview at server side. in the rowdatbound event you can check each row this way
protected void GVLeavelist_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
// Fetch each row here and calculate the data
ViewState["Total"] = 'Your Value';
}
else if((e.Row.RowType == DataControlRowType.Footer)
{
// then used viewstate value to display the total
}
}
|
|
|
|
|
|
How the filter by tag feature on codeproject is done. As a similar feature I would like to do on my project too. Can somebody help me in providing direction for the same. Thanks
Regards
PN
|
|
|
|
|
Hi Friends,
I have to import .cer certificate into .pfx , actually i converted jks(java keystore file) into pfx by using a tool , the jks file have both public key and private key but while converting to pfx i got only one key i.e., private key in pfx file, now i need to import public key(.cer) into pfx file. kindly help me friends.
Thanks in Advance
-----------
Siva kumar.
|
|
|
|
|
Hi,
I am working with the treeview control and binding it dynamically using the treeview_TreeNodePopulate method.
The code works perfectly fine and treeview behaves as it has to.
However, I am facing one annoying issue in the display of the treeview, the last node and its child do not align properly with the top nodes. Check the image below for better understanding,
http://dotnetspider.com/attachments/Forums/235454-281550-tree.GIF[^]
Note: I have blocked the text of options deliberately.
So as you can notice that the child nodes of Level 3 are not getting aligned with that of Level 1 and 2.
Following is my asp code,
<asp:TreeView ID="tvMaster" runat="server" RootNodeStyle-CssClass="rootNode" NodeStyle-HorizontalPadding="2px"<br />
NodeStyle-VerticalPadding="2px" NodeIndent="1" NodeWrap="true" ShowLines="true"<br />
CssClass="tree"><br />
<Nodes><br />
<asp:TreeNode Text="School Level" PopulateOnDemand="true" SelectAction="Expand"><br />
</asp:TreeNode><br />
</Nodes><br />
</asp:TreeView>
In the code behind, PopulateNode event fires for every node and I bind the child nodes for that node dependant on the Business logic.
Any inputs on this issue are appreciated.
Thanks,
Pranil
|
|
|
|
|
This is resolved.
It happens since
NodeIndent="1"
Thanks,
Pranil
|
|
|
|
|
Hi,
I have tried to construct a user control named EventCategory, that holds 2 dropdownlists
to select an event category. Depending on the selection in the first dropdownlist, the second
dropdownlist must be repopulated with items corresponding with the first dropdownlist selection.
Here is my control :
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="EventCategory.ascx.cs" Inherits="EventCategory" %>
<table border="0">
<tr>
<td style="width: 65px"><asp:Label ID="CategoryLabel" runat="server" Text="Category:" AssociatedControlID="CategoryList" /></td>
<td>
<asp:DropDownList ID="CategoryList" runat="server" Width="130px" AutoPostBack="True"
OnSelectedIndexChanged="CategoryList_SelectedIndexChanged" />
</td>
<td style="width: 20px" />
<td style="width: 90px"><asp:Label ID="SubCategoryLabel" runat="server" Text="SubCategory:" AssociatedControlID="SubCategoryList" /></td>
<td>
<asp:DropDownList ID="SubCategoryList" runat="server" Width="130px" />
</td>
</tr>
</table>
When i enter the control in a web page, I can wite something like this :
<!-- The user control gets registered in web.config -->
....
<UC:EventCategory ID="EventCategory" runat="server" SelectText="«Select»" Category="Parties" />
Here I want the "Parties" item to be initial selected in the CategoryList control when the page comes up.
therefore I wrote the following in code behind :
public partial class EventCategory : System.Web.UI.UserControl
{
#region Private data members
private string m_strCategory = string.Empty;
private string m_strSubCategory = string.Empty;
#endregion
#region Public properties
[Category("Appearance"),
DefaultValue(""),
Description("The event category associated with the user control.")]
public string Category
{
get { return ((CategoryList.SelectedItem != null) && (CategoryList.SelectedItem.Value != "0") ? CategoryList.SelectedItem.Text : string.Empty).Trim(); }
set { m_strCategory = value.Trim(); }
}
[Category("Appearance"),
DefaultValue(""),
Description("The event subcategory associated with the user control.")]
public string SubCategory
{
get { return ((SubCategoryList.SelectedItem != null) && (SubCategoryList.SelectedItem.Value != "0") ? SubCategoryList.SelectedItem.Text : string.Empty).Trim(); }
set { m_strSubCategory = value.Trim(); }
}
[Category("Appearance"),
DefaultValue(""),
Description("The selection text shown as first item in the user control's lists.")]
public string SelectText
{
get
{
object obj = ViewState["EventCat_SelectText"];
if (obj == null)
return string.Empty;
else
return (string)obj;
}
set { ViewState["EventCat_SelectText"] = value; }
}
#endregion
#region Public functions
public void Initialize()
{
PopulateCategoryList();
SubCategoryLabel.Enabled = false;
SubCategoryList.Enabled = false;
}
#endregion
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
Initialize();
}
protected void CategoryList_SelectedIndexChanged(object sender, EventArgs e)
{
int nCatId = Int32.Parse(CategoryList.SelectedValue);
if (nCatId > 0)
PopulateSubCategoryList(nCatId);
else
{
SubCategoryList.Items.Clear();
SubCategoryLabel.Enabled = false;
SubCategoryList.Enabled = false;
}
}
protected override void OnPreRender(EventArgs e)
{
base.OnPreRender(e);
if (!IsPostBack)
{
if (m_strCategory != string.Empty)
ListControlHelper.SelectListText(CategoryList, m_strCategory);
int nCatId = Int32.Parse(CategoryList.SelectedValue);
if (m_strSubCategory != string.Empty)
{
PopulateSubCategoryListOnEmpty(nCatId);
ListControlHelper.SelectListText(SubCategoryList, m_strSubCategory);
}
}
}
#region Private helpers
private int PopulateCategoryList()
{
EventCatsTableAdapter Adapter = new EventCatsTableAdapter();
CategoryList.DataSource = Adapter.GetAllEventCats();
CategoryList.DataTextField = "CatName";
CategoryList.DataValueField = "CatId";
CategoryList.DataBind();
if (CategoryList.Items.Count > 0)
ListControlHelper.AddListItem(CategoryList, SelectText, "0");
else
throw new InvalidOperationException(string.Format("{0} in user control {1} is empty.", CategoryList.ID, ID));
return CategoryList.Items.Count;
}
private int PopulateSubCategoryListOnEmpty(int nCatId)
{
if (SubCategoryList.Items.Count > 0)
return SubCategoryList.Items.Count;
return PopulateSubCategoryList(nCatId);
}
private int PopulateSubCategoryList(int nCatId)
{
if (!SubCategoryLabel.Enabled)
SubCategoryLabel.Enabled = true;
if (!SubCategoryList.Enabled)
SubCategoryList.Enabled = true;
EventSubCatsTableAdapter Adapter = new EventSubCatsTableAdapter();
SubCategoryList.DataSource = Adapter.GetEventSubCatsByCatId(nCatId);
SubCategoryList.DataTextField = "SubCatName";
SubCategoryList.DataValueField = "SubCatId";
SubCategoryList.DataBind();
if (SubCategoryList.Items.Count > 0)
ListControlHelper.AddListItem(SubCategoryList, SelectText, "0");
else
throw new InvalidOperationException(string.Format("{0} in user control {1} is empty.", SubCategoryList.ID, ID));
return SubCategoryList.Items.Count;
}
#endregion
}
This works fine for a simple web page, but when i place the user control in a InsertItemTemplate of a FormView and I change the
mode of the FormView to FormViewMode.Insert by an ImageButton in the page where the FormView is located I can not initial select
a dropdownlist item through the Category property of the user control. I know it is because the formview is switched to insert mode during
a postback so the IsPostBack block of the OnPreRender override gets skipped. Is there a better way to wtite the user control so that I can
select an initail value in a dropdownlist that works also in a template of a FormView.
TIA
|
|
|
|
|
I want to use the Face book and organize the FaceBook data (Friends,Comments,Posts) into my application. so how do i get it any samples regrding it.. Please let me know i will g0 through it.... Thanks
|
|
|
|
|
|
Hello,
I am trying to pass parametarst from one page to another(based on users search) and get results from the database accordingly.
Response.Redirect("~/TestPage.aspx?" + "Test1=" + Server.UrlEncode(comboTest1.Text) + "&Test2=" + Server.UrlEncode(comboTest2.Text));
The user can specify value in the one combo or in the both.
if (Request.QueryString["Test1"] != null || Request.QueryString["Test2"] != null)
{ SelectData(Request.QueryString["Test1"], Request.QueryString["Test2"]); }
DataClassesDataContext db = new DataClassesDataContext();
public IQueryable SelectData(string Test1Query, string Test2)
{
IQueryable data = from t1 in db.Test1
join t2 in db.Test2on t1.ID equals t2.fkTest1 into Joined
from j in Joined.DefaultIfEmpty()
where t1.Manufacturer == Manufacturer || c.Model == Model )
select new { ID = t1.ID, Test1 = t1.Field1, Test2 = j.Field2 };
return data;
}
If the user select only (||) value for the one combo and not the other, the code is not working. How do i fix this? I want the users to be able to perform searches by selecting values from provided number of comboboxes by their own choice.
vasja
|
|
|
|
|
Okay I think I understand what you are asking.
What is wrong with my code why can I get the LINQ to work when the user only selects one and not the other?
Well, I think The problem is the 'if' logic or the 'SelectData' method logic depending how you look at it.
I would make the logic smarter and have values substituted if they are not in range of the query.
-or-
Modify the 'SelectData' method to account for different data dependencies.
~TheArch
|
|
|
|
|
Thank you for your reply. The problem is i get an exception whenever i request the two querystrings and one of them has a null value...
|
|
|
|
|
Correct! You will need to supply either corrective logic, or correct the data values before they are passed.
IE:
MyMethod(String s1, String s2)
{
if(s1 == null)
s1 = '';
if(s2 == null)
s2 = '';
if(s1 == null && s2 == null)
else if(s1 != null && s2 != null)
else if(s1 != null && s2 == null)
else if(s1 == null && s2 != null)
}
as you can see the second method is more complicated. However you could also dynamically build the LINQ query and have the LINQ run correctly for any situation.
~TheArch
|
|
|
|
|
Yes i agree with the
if(s1 == null)
s1 = '';
if(s2 == null)
s2 = '';
but its like 20 values and i tough there is something smarter than this...i would probably use it.
Thanks!
|
|
|
|
|
Well the example only lists the two values.
If there are many values the dynamic LINQ would still do this, just build the query for the values you do have.
Another way to do it might be to change the input to the LINQ method to take an array.
static void myLINQ(String[] s)
{
for(int i=0;i<s.Count;i++)
{
if(s[i] == null)
s[i] = "";
}
}
There are several example here on The Code Project on Dynamic LINQ:
Dynamic LINQ Queries[^]
Google friendly search:
Dynamic LINq c# site:codeproject.com
|
|
|
|
|
Hi,
I was working on a desktop application basically it’s a product now the programming part is over and I have created MSI for this product.
So product and setup both parts are ready but now I have one issue with online updates for this product. I am planning to create a web service for online updates but I would like to know your thoughts as you guys are experienced.
I have used VisualStudio2008, language C# and setup and deployment project.
Please let me know, how to integrate it with setup and deployment project or with programming part or if any other right way for online updates.
Thanks
|
|
|
|
|
Updates should be download automatically from server.Please let me know how to implement it.
|
|
|
|
|
Hi Team,
I want to show one row as bold in my SSRS report. That row is static always but it can change the row no. Ex some times it may come in second sometimes it may come in 5th. but the row is constant always this needs to show in bold
So how to handle this problem
Thanks
|
|
|
|